diff options
author | Juergen Borleis <jbe@pengutronix.de> | 2023-08-25 13:10:56 +0200 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2023-09-15 15:57:52 +0200 |
commit | d8f5c6fb4b47993ae2d5dc1213140ec647284863 (patch) | |
tree | f22f8eaa0c11607418d139bbe2f8f7fb9f93065f | |
parent | 096e678150f662b8e68018da450179040e48f5e4 (diff) | |
download | DistroKit-d8f5c6fb4b47993ae2d5dc1213140ec647284863.tar.gz DistroKit-d8f5c6fb4b47993ae2d5dc1213140ec647284863.tar.xz |
v7a: barebox: enable loading kernel, dtb and initrd via fastboot
This change is similar to:
2732f93bcf4ee011cecca3518aec7e523c311d7a
"v8a: barebox: enable loading kernel, dtb and initrd via fastboot"
but for some of the v7a platforms. Due to the absence of a common environment
it only can be added for the i.MX6 based systems for now.
This change prepares all v7a platforms to load kernel, dtb and initrd as
sparse images to RAM-files for rapid development.
It exposes mmc{1,2,3} as 'fastboot' partitions and add init script to
force barebox to detect these devices and have them available for
'fastboot'.
It autostarts the USB gadget and network capability to use 'fastboot' out of
the box.
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Link: https://lore.barebox.org/20230825111056.32801-1-jbe@pengutronix.de
Adapted bsp.ref for v7a, similar to v8a.
Inspired-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
10 files changed, 36 insertions, 4 deletions
diff --git a/configs/bsp.ref b/configs/bsp.ref index cb91c78..56e83b1 100644 --- a/configs/bsp.ref +++ b/configs/bsp.ref @@ -27,9 +27,9 @@ kernel_dtb_partitions: kernel_initrd: description: | Initrd support is not needed on most embedded systems. - For v8a, we use an initrd for the fastboot usecase. + For v7a and v8a, we use an initrd for the fastboot usecase. variants: - - condition: kconfig.PTXPlatformConfig()['ARCH_ARM64'] + - condition: kconfig.PTXPlatformConfig().options['PLATFORM'] in ('v8a', 'v7a') value: True - value: False diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/boot/ram-fastboot b/configs/platform-v7a/barebox-mx6-defaultenv/boot/ram-fastboot new file mode 100755 index 0000000..ff17b26 --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/boot/ram-fastboot @@ -0,0 +1,7 @@ +#!/bin/sh + +global.bootm.image=/tmp/ram-kernel +global.bootm.initrd=/tmp/ram-initramfs +global.bootm.oftree=/tmp/ram-oftree + +global.linux.bootargs.dyn.root="rdinit=/sbin/init" diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/init/detect-mmcs b/configs/platform-v7a/barebox-mx6-defaultenv/init/detect-mmcs new file mode 100644 index 0000000..0db902d --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/init/detect-mmcs @@ -0,0 +1,3 @@ +#!/bin/sh + +detect mmc1 mmc2 mmc3 diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.acm b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.acm new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.acm @@ -0,0 +1 @@ +1 diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.bbu b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.bbu new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.bbu @@ -0,0 +1 @@ +1 diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.net.autostart b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.net.autostart new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.net.autostart @@ -0,0 +1 @@ +1 diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.partitions b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.partitions new file mode 100644 index 0000000..15c7d42 --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/fastboot.partitions @@ -0,0 +1 @@ +/dev/mmc1(mmc1)o,/dev/mmc2(mmc2)o,/dev/mmc3(mmc3)o,/tmp/ram-kernel(ram-kernel)c,/tmp/ram-initramfs(ram-initramfs)c,/tmp/ram-oftree(ram-oftree)c diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/usbgadget.autostart b/configs/platform-v7a/barebox-mx6-defaultenv/nv/usbgadget.autostart new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/usbgadget.autostart @@ -0,0 +1 @@ +1 diff --git a/configs/platform-v7a/kernelconfig b/configs/platform-v7a/kernelconfig index ef19091..228358a 100644 --- a/configs/platform-v7a/kernelconfig +++ b/configs/platform-v7a/kernelconfig @@ -190,7 +190,15 @@ CONFIG_NET_NS=y # CONFIG_CHECKPOINT_RESTORE is not set # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_RELAY is not set -# CONFIG_BLK_DEV_INITRD is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_RD_GZIP=y +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +# CONFIG_RD_ZSTD is not set # CONFIG_BOOT_CONFIG is not set CONFIG_INITRAMFS_PRESERVE_MTIME=y CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y @@ -4089,6 +4097,7 @@ CONFIG_XZ_DEC_ARM=y # CONFIG_XZ_DEC_MICROLZMA is not set CONFIG_XZ_DEC_BCJ=y # CONFIG_XZ_DEC_TEST is not set +CONFIG_DECOMPRESS_GZIP=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_ASSOCIATIVE_ARRAY=y CONFIG_HAS_IOMEM=y diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig index 1ecbda0..29a884b 100644 --- a/configs/platform-v7a/platformconfig +++ b/configs/platform-v7a/platformconfig @@ -261,7 +261,15 @@ PTXCONF_IMAGE_KERNEL_INSTALL_EARLY=y PTXCONF_IMAGE_LXA_MC1=y # PTXCONF_IMAGE_RAUC is not set PTXCONF_IMAGE_RIOTBOARD=y -# PTXCONF_IMAGE_ROOT_CPIO is not set +PTXCONF_IMAGE_ROOT_CPIO=y +# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_NONE is not set +PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_GZ=y +# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_ZSTD is not set +# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_XZ is not set +# PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_MODE_LZOP is not set +# PTXCONF_IMAGE_ROOT_CPIO_CUSTOM_COMPRESSION is not set +PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_SUFFIX=".gz" +PTXCONF_IMAGE_ROOT_CPIO_COMPRESSION_UTIL="gzip" PTXCONF_IMAGE_ROOT_EXT=y PTXCONF_IMAGE_ROOT_EXT_SIZE="125%" # PTXCONF_IMAGE_ROOT_EXT_EXT2 is not set |