mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Espressobin u boot fit image (#3766)
* add the image tree source for building FIT images for ebin * add FIT image generation to BSP files * Change to using FIT image to boot * make fit-image script executable * add the ability to choose board dtb in armbianEnv.txt
This commit is contained in:
@@ -1 +1,2 @@
|
||||
board_version=v5
|
||||
verbosity=1
|
||||
|
||||
@@ -8,10 +8,8 @@ env import -t ${scriptaddr} ${filesize}
|
||||
|
||||
setenv bootargs "$console root=${rootdev} rootfstype=${rootfstype} rootwait loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
|
||||
|
||||
load $devtype ${devnum}:${distro_bootpart} $kernel_addr_r ${prefix}Image
|
||||
load $devtype ${devnum}:${distro_bootpart} $ramdisk_addr_r ${prefix}uInitrd
|
||||
load $devtype ${devnum}:${distro_bootpart} $fdt_addr_r ${prefix}dtb/$fdtfile
|
||||
load $devtype ${devnum}:${distro_bootpart} $ramdisk_addr_r ${prefix}espressobin.itb
|
||||
|
||||
booti $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
|
||||
bootm ${ramdisk_addr_r}#$board_version
|
||||
|
||||
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr.uimg
|
||||
|
||||
2
config/its/README
Normal file
2
config/its/README
Normal file
@@ -0,0 +1,2 @@
|
||||
This directory holds Image Tree Source (its) files
|
||||
These files are used by the device tree builder to create image tree binaries
|
||||
78
config/its/marvell/a37xx/espressobin.its
Normal file
78
config/its/marvell/a37xx/espressobin.its
Normal file
@@ -0,0 +1,78 @@
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
description = "EspressoBIN 3720 FIT Image";
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
kernel {
|
||||
description = "Vanilla Linux kernel";
|
||||
data = /incbin/("/boot/vmlinuz-$(uname -r)");
|
||||
type = "kernel";
|
||||
arch = "arm64";
|
||||
os = "linux";
|
||||
compression = "lzma";
|
||||
load = <0x07000000>;
|
||||
entry = <0x07000000>;
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
ramdisk {
|
||||
description = "Boot ramdisk";
|
||||
data = /incbin/("/boot/initrd.img-$(uname -r)");
|
||||
type = "ramdisk";
|
||||
arch = "arm64";
|
||||
os = "linux";
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
fdtv5 {
|
||||
description = "Flattened Device Tree ebinv5";
|
||||
data = /incbin/("/boot/dtb/marvell/armada-3720-espressobin.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
load = <0x06f00000>;
|
||||
entry = <0x06f00000>;
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
fdtv7 {
|
||||
description = "Flattened Device Tree ebinv7";
|
||||
data = /incbin/("/boot/dtb/marvell/armada-3720-espressobin-v7.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
load = <0x06f00000>;
|
||||
entry = <0x06f00000>;
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "v5";
|
||||
v5 {
|
||||
description = "Standard Boot ebinv5";
|
||||
kernel = "kernel";
|
||||
ramdisk = "ramdisk";
|
||||
fdt = "fdtv5";
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
v7 {
|
||||
description = "Standard Boot ebinv7";
|
||||
kernel = "kernel";
|
||||
ramdisk = "ramdisk";
|
||||
fdt = "fdtv7";
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -75,11 +75,15 @@ family_tweaks()
|
||||
{
|
||||
chroot $SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1"
|
||||
[[ -f $SDCARD/etc/netplan/armbian-default.yaml ]] && sed -i "s/^ renderer.*/ renderer: networkd/" $SDCARD/etc/netplan/armbian-default.yaml
|
||||
cp $SRC/packages/bsp/mvebu64/10* $SDCARD/etc/systemd/network/
|
||||
cp $SRC/packages/bsp/mvebu64/networkd/10* $SDCARD/etc/systemd/network/
|
||||
echo "#Marvell Espressobin Console" >> $SDCARD/etc/securetty
|
||||
echo "ttyMV0" >> $SDCARD/etc/securetty
|
||||
}
|
||||
|
||||
family_tweaks_bsp() {
|
||||
cp "$SRC/packages/bsp/mvebu64/initramfs/99-uboot-fit" "$destination/etc/initramfs/post-update.d/"
|
||||
}
|
||||
|
||||
atf_custom_postprocess()
|
||||
{
|
||||
# prepare compilers for postprocess
|
||||
|
||||
90
packages/bsp/mvebu64/initramfs/99-uboot-fit
Executable file
90
packages/bsp/mvebu64/initramfs/99-uboot-fit
Executable file
@@ -0,0 +1,90 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/armbian-release
|
||||
|
||||
echo "update-initramfs: Converting to u-boot FIT image" >&2
|
||||
kernel_f=$(mktemp)
|
||||
initrd_f="/boot/initrd.img-$1"
|
||||
|
||||
lzma -c -9e /boot/vmlinuz-$1 > $kernel_f
|
||||
|
||||
mkimage -f - /boot/espressobin.itb <<EOF
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
description = "EspressoBIN 3720 FIT Image";
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
kernel {
|
||||
description = "Vanilla Linux kernel";
|
||||
data = /incbin/("$kernel_f");
|
||||
type = "kernel";
|
||||
arch = "arm64";
|
||||
os = "linux";
|
||||
compression = "lzma";
|
||||
load = <0x07000000>;
|
||||
entry = <0x07000000>;
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
ramdisk {
|
||||
description = "Boot ramdisk";
|
||||
data = /incbin/("$initrd_f");
|
||||
type = "ramdisk";
|
||||
arch = "arm64";
|
||||
os = "linux";
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
fdtv5 {
|
||||
description = "Flattened Device Tree ebinv5";
|
||||
data = /incbin/("/boot/dtb/marvell/armada-3720-espressobin.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
load = <0x06f00000>;
|
||||
entry = <0x06f00000>;
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
fdtv7 {
|
||||
description = "Flattened Device Tree ebinv7";
|
||||
data = /incbin/("/boot/dtb/marvell/armada-3720-espressobin-v7.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
load = <0x06f00000>;
|
||||
entry = <0x06f00000>;
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "v5";
|
||||
v5 {
|
||||
description = "Standard Boot ebinv5";
|
||||
kernel = "kernel";
|
||||
ramdisk = "ramdisk";
|
||||
fdt = "fdtv5";
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
v7 {
|
||||
description = "Standard Boot ebinv7";
|
||||
kernel = "kernel";
|
||||
ramdisk = "ramdisk";
|
||||
fdt = "fdtv7";
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
EOF
|
||||
Reference in New Issue
Block a user