From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
Cc: Adam Duskett <aduskett@gmail.com>,
Thierry Bultel <thierry.bultel@linatsea.fr>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH next v5 2/3] fs/cpio: new option to use dracut tool
Date: Mon, 15 Aug 2022 15:05:13 +0200 [thread overview]
Message-ID: <20220815130513.GX2854108@scaer> (raw)
In-Reply-To: <20220815111710.1459820-2-arnout@mind.be>
Arnout, All,
On 2022-08-15 13:17 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:
> From: Thierry Bultel <thierry.bultel@linatsea.fr>
>
> Adds an option to invoke the dracut host tool, providing
> a configuration file, instead of having a full cpio archive
> of the whole target directory.
[--SNIP--]
> diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in
> index c1151a2881..de83aaad65 100644
> --- a/fs/cpio/Config.in
> +++ b/fs/cpio/Config.in
> @@ -7,6 +7,40 @@ config BR2_TARGET_ROOTFS_CPIO
>
> if BR2_TARGET_ROOTFS_CPIO
>
> +choice
> + prompt "cpio type"
> + default BR2_TARGET_ROOTFS_CPIO_FULL
> +
> +config BR2_TARGET_ROOTFS_CPIO_FULL
> + bool "cpio the whole root filesystem"
> + help
> + Build a cpio archive containing the whole the root filesystem.
> +
> +config BR2_TARGET_ROOTFS_CPIO_DRACUT
> + bool "Invoke dracut to make a partial initramfs"
> + select BR2_PACKAGE_HOST_DRACUT
> + select BR2_PACKAGE_HOST_UBOOT_TOOLS
As seen on IRC, host-uboot-tools are not required just for dracut.
> +if BR2_TARGET_ROOTFS_CPIO_DRACUT
Empty line after an 'if'...
> +config BR2_TARGET_ROOTFS_CPIO_DRACUT_CONF_FILE
> + string "dracut configuration file"
> + default "fs/cpio/dracut.conf"
> + help
> + Dracut configuration file. It determines which parts of the
> + rootfs get included in the cpio image. See dracut.conf(5) or
> + https://github.com/dracutdevs/dracut/blob/master/man/dracut.conf.5.asc
> +
> + The default configuration file is suitable for busybox init.
> + It doesn't, however, pivot_root into a full rootfs.
... and before an 'endif'.
> +endif
> +
> choice
> prompt "Compression method"
> default BR2_TARGET_ROOTFS_CPIO_NONE
> diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
> index 81f8c393d1..b62d804ad8 100644
> --- a/fs/cpio/cpio.mk
> +++ b/fs/cpio/cpio.mk
> @@ -36,6 +36,8 @@ ROOTFS_CPIO_DEPENDENCIES += host-cpio
> ROOTFS_CPIO_OPTS += --reproducible
> endif
>
> +ifeq ($(BR2_TARGET_ROOTFS_CPIO_FULL),y)
> +
> define ROOTFS_CPIO_CMD
We customarily do not define the _CMD (or _CMDS) conditionally. Instead,
we define conditional macros, and we expand them all in an unconditional
_CMD (or _CMDS) macro.
> cd $(TARGET_DIR) && \
> find . \
> @@ -44,6 +46,37 @@ define ROOTFS_CPIO_CMD
> > $@
> endef
>
> +else ifeq ($(BR2_TARGET_ROOTFS_CPIO_DRACUT),y)
> +
> +ROOTFS_CPIO_DEPENDENCIES += host-dracut
> +
> +ifeq ($(BR_BUILDING):$(BR2_TARGET_ROOTFS_CPIO_DRACUT_CONF_FILE),y:)
> +$(error No dracut config file name specified, check your BR2_TARGET_ROOTFS_CPIO_DRACUT_CONF_FILE setting)
> +endif
> +
> +ifeq ($(BR2_LINUX_KERNEL),y)
> +ROOTFS_CPIO_DEPENDENCIES += linux
> +ROOTFS_CPIO_OPTS += --kver $(LINUX_VERSION_PROBED)
> +else
> +ROOTFS_CPIO_OPTS += --no-kernel
> +endif
> +
> +define ROOTFS_CPIO_CMD
> + mkdir -p $(ROOTFS_CPIO_DIR)/tmp
> +
> + $(HOST_DIR)/bin/dracut \
> + $(ROOTFS_CPIO_OPTS) \
> + -c $(BR2_TARGET_ROOTFS_CPIO_DRACUT_CONF_FILE) \
> + --sysroot $(TARGET_DIR) \
Hrmm.. --sysroot is misleading in our situation. Also, it can be spelt
-r so our wrapper must also cope with it (in case it is called from a
post-image script).
[--SNIP--]
> diff --git a/fs/cpio/dracut.conf b/fs/cpio/dracut.conf
> new file mode 100644
> index 0000000000..6184457723
> --- /dev/null
> +++ b/fs/cpio/dracut.conf
> @@ -0,0 +1,93 @@
[--SNIP--]
> +"
> +
Spurious emoty line at EOF.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-08-15 13:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 11:17 [Buildroot] [PATCH next v5 1/3] package/dracut: new host package Arnout Vandecappelle (Essensium/Mind)
2022-08-15 11:17 ` [Buildroot] [PATCH next v5 2/3] fs/cpio: new option to use dracut tool Arnout Vandecappelle (Essensium/Mind)
2022-08-15 13:05 ` Yann E. MORIN [this message]
2022-08-15 16:37 ` Arnout Vandecappelle
2022-08-18 21:09 ` Yann E. MORIN
2022-08-15 11:17 ` [Buildroot] [PATCH next v5 3/3] support/testing/tests/fs/test_cpio.py: new runtime test Arnout Vandecappelle (Essensium/Mind)
2022-08-18 21:10 ` Yann E. MORIN
2022-08-15 12:36 ` [Buildroot] [PATCH next v5 1/3] package/dracut: new host package Yann E. MORIN
2022-08-15 16:27 ` Arnout Vandecappelle via buildroot
2022-08-18 21:09 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220815130513.GX2854108@scaer \
--to=yann.morin.1998@free.fr \
--cc=aduskett@gmail.com \
--cc=arnout@mind.be \
--cc=buildroot@buildroot.org \
--cc=thierry.bultel@linatsea.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.