boot-wrapper-aarch64 configuration options
I needed these patches to expose some of boot-wrapper-aarch64's underlying configuration options. I hope it's useful.
PATCH 1/1 boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
--- boot/boot-wrapper-aarch64/Config.in | 8 ++++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-)
boot/boot-wrapper-aarch64/Config.in +8 -0
@@ -32,4 +32,12 @@ config BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS Kernel bootargs to embed inside the image generated by the boot wrapper. +config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK + string "Ramdisk" + default "" + help + Embed an initramfs file in the kernel image, and provide + linux,initrd-start and linux,initrd-end properties in the /chosen device + tree node. + endif
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk +4 -0
@@ -30,6 +30,10 @@ BOOT_WRAPPER_AARCH64_CONF_OPTS = \ --with-kernel-dir=$(LINUX_DIR) \ --with-cmdline=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS) +ifneq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),) + BOOT_WRAPPER_AARCH64_CONF_OPTS += --with-initrd=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK) +endif + # We need to convince the configure script that the Linux kernel tree # exists, as well as the DTB and the kernel Image. Even though those # are available on the build machine, the configure script uses
Signature · 1 line
1.7.1
PATCH 1/1 boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
Hello,
Quoted 5 lines · Hollis Blanchard
Signed-off-by Hollis Blanchard <[email protected]>--- boot/boot-wrapper-aarch64/Config.in | 8 ++++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-)
Thanks for your patch, sorry for the somewhat slow reply.
boot/boot-wrapper-aarch64/Config.in config BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS · line 37
Quoted 3 lines
boot/boot-wrapper-aarch64/Config.in +3
-0+config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK + string "Ramdisk" + default ""
I would like this option to include the filesystem produced by Buildroot (in cpio format) as the initramfs. So something like:
bool "Include ramdisk in image"
depends on BR2_TARGET_ROOTFS_CPIO
boot/boot-wrapper-aarch64/Config.in config BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS · line 39
Quoted 2 lines
boot/boot-wrapper-aarch64/Config.in +2
-0+ help + Embed an initramfs file in the kernel image, and provide
It does not embed the initramfs in the kernel image, but in the boot wrapper image.
Quoted 9 lines
boot/boot-wrapper-aarch64/Config.in +3
-0+ linux,initrd-start and linux,initrd-end properties in the /chosen device + tree node. + endifboot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk +0
-0
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk BOOT_WRAPPER_AARCH64_CONF_OPTS = \ · line 34
Quoted 5 lines
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk +2
-0@@ -30,6 +30,10 @@ BOOT_WRAPPER_AARCH64_CONF_OPTS = \ --with-kernel-dir=$(LINUX_DIR) \ --with-cmdline=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS) +ifneq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),) + BOOT_WRAPPER_AARCH64_CONF_OPTS += --with-initrd=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK)
Don't indent code inside conditions.
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk BOOT_WRAPPER_AARCH64_CONF_OPTS = \ · line 35
Quoted 1 line
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk +1
-0+endif
It should be something like:
ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),y) BOOT_WRAPPER_AARCH64_CONF_OPTS += --with-initrd=$(BINARIES_DIR)/rootfs.cpio BOOT_WRAPPER_AARCH64_DEPENDENCIES += rootfs-cpio
endif
or something along those lines.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
Quoted 9 lines · Thomas Petazzoni
Hello,
Quoted 5 lines · Hollis Blanchard
Signed-off-by Hollis Blanchard <[email protected]>--- boot/boot-wrapper-aarch64/Config.in | 8 ++++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-)Thanks for your patch, sorry for the somewhat slow reply.
No problem; thanks for catching it after a busy week of travel.
Quoted 8 lines
boot/boot-wrapper-aarch64/Config.in config BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS · line 37
Quoted 3 lines
boot/boot-wrapper-aarch64/Config.in +3
-0+config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK + string "Ramdisk" + default ""I would like this option to include the filesystem produced by Buildroot (in cpio format) as the initramfs. So something like:
bool "Include ramdisk in image"
depends onBR2_TARGET_ROOTFS_CPIO
I'm actually using it to embed an AOSP ramdisk.img, so I have BR2_TARGET_ROOTFS_CPIO=n, but I can see how that would be more generally useful. :-) Perhaps options like these?
config STANDARD_RAMDISK
bool "Include standard ramdisk in image"
depends on BR2_TARGET_ROOTFS_CPIO
config EXTERNAL_RAMDISK
bool "Include external ramdisk in image"
depends on !STANDARD_RAMDISK
config EXTERNAL_RAMDISK_PATH
string "External ramdisk path"
depends on EXTERNAL_RAMDISK
Signature · 2 lines
Hollis Blanchard <[email protected]> Mentor Graphics Emulation Division
PATCH 1/1 boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
In reply to Thomas PetazzoniQuoted 11 lines · Thomas Petazzoni
Quoted 3 lines
boot/boot-wrapper-aarch64/Config.in | 8 ++++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-)[...]
It should be something like:
ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),y)
BOOT_WRAPPER_AARCH64_CONF_OPTS+= --with-initrd=$(BINARIES_DIR)/rootfs.cpioBOOT_WRAPPER_AARCH64_DEPENDENCIES+= rootfs-cpio
endif
I'm preparing a resend on this, but I'm having trouble with the dependency:
$ rm /scratch1/hblancha/build/buildroot/images/rootfs.cpio $ make O=/scratch1/hblancha/build/buildroot boot-wrapper-aarch64-dirclean all [...] /scratch1/hblancha/build/buildroot/host/usr/bin/aarch64-buildroot-linux-gnu-ld: cannot find /scratch1/hblancha/build/buildroot/images/rootfs.cpio
I can see that rootfs-* is defined and used in fs/, but, well, ... it doesn't seem to be working in this boot/ Makefile. Any advice?
Hollis Blanchard <[email protected]>
Mentor Graphics Emulation Division
PATCH 1/1 boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
Quoted 14 lines · Hollis Blanchard
Quoted 11 lines · Thomas Petazzoni
Quoted 3 lines
boot/boot-wrapper-aarch64/Config.in | 8 ++++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-)[...]
It should be something like:
ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),y)
BOOT_WRAPPER_AARCH64_CONF_OPTS+= --with-initrd=$(BINARIES_DIR)/rootfs.cpioBOOT_WRAPPER_AARCH64_DEPENDENCIES+= rootfs-cpio
endifI'm preparing a resend on this, but I'm having trouble with the dependency:
Quoted 8 lines
$ rm /scratch1/hblancha/build/buildroot/images/rootfs.cpio $ make O=/scratch1/hblancha/build/buildroot boot-wrapper-aarch64-dirclean all [...] /scratch1/hblancha/build/buildroot/host/usr/bin/aarch64-buildroot-linux-gnu-ld: cannot find /scratch1/hblancha/build/buildroot/images/rootfs.cpioI can see that rootfs-* is defined and used in
fs/, but, well, ... it doesn't seem to be working in this boot/Makefile. Any advice?
Difficult to say without seeing the patch. Does it work correctly if you call
'make rootfs-cpio boot-wrapper-arch64'?
Regards,
Arnout
Quoted 9 lines
Hollis Blanchard <[email protected]>
Mentor Graphics Emulation Division_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/1 boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
Quoted 21 lines · Arnout Vandecappelle
Quoted 20 lines · Hollis Blanchard
Quoted 11 lines · Thomas Petazzoni
Quoted 3 lines
boot/boot-wrapper-aarch64/Config.in | 8 ++++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-)[...]
It should be something like:
ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),y)
BOOT_WRAPPER_AARCH64_CONF_OPTS+= --with-initrd=$(BINARIES_DIR)/rootfs.cpioBOOT_WRAPPER_AARCH64_DEPENDENCIES+= rootfs-cpio
endifI'm preparing a resend on this, but I'm having trouble with the dependency:
$ rm /scratch1/hblancha/build/buildroot/images/rootfs.cpio $ make O=/scratch1/hblancha/build/buildroot boot-wrapper-aarch64-dirclean all [...] /scratch1/hblancha/build/buildroot/host/usr/bin/aarch64-buildroot-linux-gnu-ld: cannot find /scratch1/hblancha/build/buildroot/images/rootfs.cpio
Quoted 4 lines
Quoted 2 lines
I can see that rootfs-* is defined and used in
fs/, but, well, ... it doesn't seem to be working in this boot/Makefile. Any advice?Difficult to say without seeing the patch. Does it work correctly if you call
'make rootfs-cpio boot-wrapper-arch64'?
Same error. Earlier I see this:
make: Circular /scratch1/hblancha/build/buildroot/build/boot-wrapper-aarch64-4266507a84f8c06452109d38e0350d4759740694/.stamp_configured <- rootfs-cpio dependency dropped.
Full patch is here:
Author: Hollis Blanchard <[email protected]> Date: Mon Sep 26 15:48:12 2016 -0700
boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
boot/boot-wrapper-aarch64/Config.in +24 -0
@@ -32,6 +32,30 @@ config BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS Kernel bootargs to embed inside the image generated by the boot wrapper. +choice + prompt "Embedded ramdisk" + default BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_NONE + help + Embed an initramfs file in the bootwrapper image, and provide + linux,initrd-start and linux,initrd-end properties in the /chosen + device tree node. + +config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_NONE + bool "None" + +config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_BUILDROOT + bool "Buildroot ramdisk" + depends on BR2_TARGET_ROOTFS_CPIO + +config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_CUSTOM + bool "Custom ramdisk" + +endchoice + +config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_CUSTOM_PATH + depends on BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_CUSTOM + string "Path to external ramdisk" + config BR2_TARGET_BOOT_WRAPPER_AARCH64_PSCI bool "Boot secondary SMP cores using PSCI" help
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk +7 -0
@@ -36,6 +36,13 @@ else BOOT_WRAPPER_AARCH64_CONF_OPTS += --disable-psci endif +ifneq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_BUILDROOT),) +BOOT_WRAPPER_AARCH64_CONF_OPTS += --with-initrd=$(BINARIES_DIR)/rootfs.cpio +BOOT_WRAPPER_AARCH64_DEPENDENCIES += rootfs-cpio +else ifneq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_CUSTOM),) +BOOT_WRAPPER_AARCH64_CONF_OPTS += --with-initrd=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK_CUSTOM_PATH) +endif + # We need to convince the configure script that the Linux kernel tree # exists, as well as the DTB and the kernel Image. Even though those # are available on the build machine, the configure script uses
Hollis Blanchard <[email protected]>
Mentor Graphics Emulation Division
PATCH 1/1 boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
Quoted 24 lines · Hollis Blanchard
Quoted 23 lines · Arnout Vandecappelle
Quoted 22 lines · Hollis Blanchard
Quoted 11 lines · Thomas Petazzoni
Quoted 3 lines
boot/boot-wrapper-aarch64/Config.in | 8 ++++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-)[...]
It should be something like:
ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),y)
BOOT_WRAPPER_AARCH64_CONF_OPTS+= --with-initrd=$(BINARIES_DIR)/rootfs.cpioBOOT_WRAPPER_AARCH64_DEPENDENCIES+= rootfs-cpio
endifI'm preparing a resend on this, but I'm having trouble with the dependency:
$ rm /scratch1/hblancha/build/buildroot/images/rootfs.cpio $ make O=/scratch1/hblancha/build/buildroot boot-wrapper-aarch64-dirclean all [...] /scratch1/hblancha/build/buildroot/host/usr/bin/aarch64-buildroot-linux-gnu-ld: cannot find /scratch1/hblancha/build/buildroot/images/rootfs.cpioI can see that rootfs-* is defined and used in
fs/, but, well, ... it doesn't seem to be working in this boot/Makefile. Any advice?
Quoted 7 lines
Quoted 2 lines
Difficult to say without seeing the patch. Does it work correctly if you call
'make rootfs-cpio boot-wrapper-arch64'?Same error. Earlier I see this:
make: Circular /scratch1/hblancha/build/buildroot/build/boot-wrapper-aarch64-4266507a84f8c06452109d38e0350d4759740694/.stamp_configured <- rootfs-cpio dependency dropped.
Ah, of course: rootfs-cpio depends on PACKAGES, and boot-wrapper-aarch64 is in
PACKAGES. Same issue as with initramfs, and which is the reason why initramfs doesn't use the normal DEPENDENCIES approach.
A fundamental solution would probably involve a change in the infra to support
leaving out a package from PACKAGES (but then there has to be another way of making sure it *does* get built).
But for now, all I can think of is to do it similar to how we do it for linux:
create a filesystem target for it, and then add some special custom rule to boot-wrapper-aarch64 to (re)build it with the cpio archive.
Quoted 8 lines
Full patch is here:
Author: Hollis Blanchard <[email protected]> Date: Mon Sep 26 15:48:12 2016 -0700boot-wrapper-aarch64: Allow users to specify an initrd/initramfs file.
Signed-off-by Hollis Blanchard <[email protected]>
BTW you have a missing blank line between the summary and the Sob.
Regards,
Arnout
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/1 boot-wrapper-aarch64: Allow users to select the PSCI SMP boot method
In reply to Hollis Blanchard--- boot/boot-wrapper-aarch64/Config.in | 7 +++++++ boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 4 ++++ 2 files changed, 11 insertions(+), 0 deletions(-)
boot/boot-wrapper-aarch64/Config.in +7 -0
@@ -40,4 +40,11 @@ config BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK linux,initrd-start and linux,initrd-end properties in the /chosen device tree node. +config BR2_TARGET_BOOT_WRAPPER_AARCH64_PSCI + bool "Boot secondary SMP cores using PSCI" + default n + help + Boot secondary SMP cores using PSCI firmware calls. If n, use the spin-table + method instead. + endif
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk +4 -0
@@ -34,6 +34,10 @@ ifneq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK),) BOOT_WRAPPER_AARCH64_CONF_OPTS += --with-initrd=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_RAMDISK) endif +ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_PSCI),y) + BOOT_WRAPPER_AARCH64_CONF_OPTS += --enable-psci +endif + # We need to convince the configure script that the Linux kernel tree # exists, as well as the DTB and the kernel Image. Even though those # are available on the build machine, the configure script uses
Signature · 1 line
1.7.1