Message ID | 20241212-kbuild-deb-pkg-no-initrd-for-um-v1-1-23243b5c7093@fjasle.eu (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | kbuild: deb-pkg: Do request initrd for user-mode-linux | expand |
On Thu, Dec 12, 2024 at 6:25 PM Nicolas Schier <nicolas@fjasle.eu> wrote: > > Do not request initramfs-tools to build an initrd image for > user-mode-linux. > > Building and installing a user-mode-linux Debian package with > > make bindeb-pkg ARCH=um > apt install ./user-mode-linux-*.deb > > fails reasonable due to missing kernel config in /boot > (KVER=6.13.0-rc2-00006-g8f2db654f79c): > > update-initramfs: Generating /usr/bin/initrd.img-${KVER} > grep: /boot/config-${KVER}: No such file or directory > W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using > gzip > grep: /boot/config-${KVER}: No such file or directory > E: gzip compression (CONFIG_RD_GZIP) not supported by kernel > update-initramfs: failed for /usr/bin/initrd.img-${KVER} with 1. > run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return > code 1 > ... > dpkg: error processing package user-mode-linux-${KVER} (--configure): > installed user-mode-linux-${KVER} package post-installation script > subprocess returned error exit status 1 > Errors were encountered while processing: > user-mode-linux-${KVER} > E: Sub-process /usr/bin/dpkg returned an error code (1) > > There is no need to build initrd for user-mode-linux, so stop requesting > it. > > Signed-off-by: Nicolas Schier <nicolas@fjasle.eu> > --- I think this change is wrong. maint scripts do not make sense for user-mode-linux. > scripts/package/builddeb | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/scripts/package/builddeb b/scripts/package/builddeb > index b497b933901013b1b8b82c2c340a88c9257c6193..d88ee487a1f2cfa3365350abe5b2203f48980d36 100755 > --- a/scripts/package/builddeb > +++ b/scripts/package/builddeb > @@ -46,10 +46,12 @@ install_linux_image () { > cp System.map "${pdir}/usr/lib/uml/modules/${KERNELRELEASE}/System.map" > cp ${KCONFIG_CONFIG} "${pdir}/usr/share/doc/${pname}/config" > gzip "${pdir}/usr/share/doc/${pname}/config" > + initrd_wanted=No > else > mkdir -p "${pdir}/boot" > cp System.map "${pdir}/boot/System.map-${KERNELRELEASE}" > cp ${KCONFIG_CONFIG} "${pdir}/boot/config-${KERNELRELEASE}" > + initrd_wanted=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No) > fi > > # Not all arches have the same installed path in debian > @@ -82,7 +84,7 @@ install_linux_image () { > export DEB_MAINT_PARAMS="\$*" > > # Tell initramfs builder whether it's wanted > - export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No) > + export INITRD=${initrd_wanted} > > # run-parts will error out if one of its directory arguments does not > # exist, so filter the list of hook directories accordingly. > > --- > base-commit: 8f2db654f79c7fa579c64eda2b5db44553d6e513 > change-id: 20241212-kbuild-deb-pkg-no-initrd-for-um-1c7b9ab2f264 > > Best regards, > -- > Nicolas >
On Thu, Dec 12, 2024 at 09:12:58PM +0900, Masahiro Yamada wrote: > On Thu, Dec 12, 2024 at 6:25 PM Nicolas Schier <nicolas@fjasle.eu> wrote: > > > > Do not request initramfs-tools to build an initrd image for > > user-mode-linux. > > > > Building and installing a user-mode-linux Debian package with > > > > make bindeb-pkg ARCH=um > > apt install ./user-mode-linux-*.deb > > > > fails reasonable due to missing kernel config in /boot > > (KVER=6.13.0-rc2-00006-g8f2db654f79c): > > > > update-initramfs: Generating /usr/bin/initrd.img-${KVER} > > grep: /boot/config-${KVER}: No such file or directory > > W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using > > gzip > > grep: /boot/config-${KVER}: No such file or directory > > E: gzip compression (CONFIG_RD_GZIP) not supported by kernel > > update-initramfs: failed for /usr/bin/initrd.img-${KVER} with 1. > > run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return > > code 1 > > ... > > dpkg: error processing package user-mode-linux-${KVER} (--configure): > > installed user-mode-linux-${KVER} package post-installation script > > subprocess returned error exit status 1 > > Errors were encountered while processing: > > user-mode-linux-${KVER} > > E: Sub-process /usr/bin/dpkg returned an error code (1) > > > > There is no need to build initrd for user-mode-linux, so stop requesting > > it. > > > > Signed-off-by: Nicolas Schier <nicolas@fjasle.eu> > > --- > > I think this change is wrong. > > maint scripts do not make sense for user-mode-linux. yes, sure. For completeness: The Debian user-mode-linux package has maintainter scripts for setting up / tearing down the update-alternatives link, but that is probably not needed here. I am going to send a new patch to install maint scripts only for non-um archs. Kind regards, Nicolas > > > > > > > scripts/package/builddeb | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/scripts/package/builddeb b/scripts/package/builddeb > > index b497b933901013b1b8b82c2c340a88c9257c6193..d88ee487a1f2cfa3365350abe5b2203f48980d36 100755 > > --- a/scripts/package/builddeb > > +++ b/scripts/package/builddeb > > @@ -46,10 +46,12 @@ install_linux_image () { > > cp System.map "${pdir}/usr/lib/uml/modules/${KERNELRELEASE}/System.map" > > cp ${KCONFIG_CONFIG} "${pdir}/usr/share/doc/${pname}/config" > > gzip "${pdir}/usr/share/doc/${pname}/config" > > + initrd_wanted=No > > else > > mkdir -p "${pdir}/boot" > > cp System.map "${pdir}/boot/System.map-${KERNELRELEASE}" > > cp ${KCONFIG_CONFIG} "${pdir}/boot/config-${KERNELRELEASE}" > > + initrd_wanted=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No) > > fi > > > > # Not all arches have the same installed path in debian > > @@ -82,7 +84,7 @@ install_linux_image () { > > export DEB_MAINT_PARAMS="\$*" > > > > # Tell initramfs builder whether it's wanted > > - export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No) > > + export INITRD=${initrd_wanted} > > > > # run-parts will error out if one of its directory arguments does not > > # exist, so filter the list of hook directories accordingly. > > > > --- > > base-commit: 8f2db654f79c7fa579c64eda2b5db44553d6e513 > > change-id: 20241212-kbuild-deb-pkg-no-initrd-for-um-1c7b9ab2f264 > > > > Best regards, > > -- > > Nicolas > > > > > -- > Best Regards > Masahiro Yamada >
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index b497b933901013b1b8b82c2c340a88c9257c6193..d88ee487a1f2cfa3365350abe5b2203f48980d36 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -46,10 +46,12 @@ install_linux_image () { cp System.map "${pdir}/usr/lib/uml/modules/${KERNELRELEASE}/System.map" cp ${KCONFIG_CONFIG} "${pdir}/usr/share/doc/${pname}/config" gzip "${pdir}/usr/share/doc/${pname}/config" + initrd_wanted=No else mkdir -p "${pdir}/boot" cp System.map "${pdir}/boot/System.map-${KERNELRELEASE}" cp ${KCONFIG_CONFIG} "${pdir}/boot/config-${KERNELRELEASE}" + initrd_wanted=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No) fi # Not all arches have the same installed path in debian @@ -82,7 +84,7 @@ install_linux_image () { export DEB_MAINT_PARAMS="\$*" # Tell initramfs builder whether it's wanted - export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No) + export INITRD=${initrd_wanted} # run-parts will error out if one of its directory arguments does not # exist, so filter the list of hook directories accordingly.
Do not request initramfs-tools to build an initrd image for user-mode-linux. Building and installing a user-mode-linux Debian package with make bindeb-pkg ARCH=um apt install ./user-mode-linux-*.deb fails reasonable due to missing kernel config in /boot (KVER=6.13.0-rc2-00006-g8f2db654f79c): update-initramfs: Generating /usr/bin/initrd.img-${KVER} grep: /boot/config-${KVER}: No such file or directory W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip grep: /boot/config-${KVER}: No such file or directory E: gzip compression (CONFIG_RD_GZIP) not supported by kernel update-initramfs: failed for /usr/bin/initrd.img-${KVER} with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 ... dpkg: error processing package user-mode-linux-${KVER} (--configure): installed user-mode-linux-${KVER} package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: user-mode-linux-${KVER} E: Sub-process /usr/bin/dpkg returned an error code (1) There is no need to build initrd for user-mode-linux, so stop requesting it. Signed-off-by: Nicolas Schier <nicolas@fjasle.eu> --- scripts/package/builddeb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- base-commit: 8f2db654f79c7fa579c64eda2b5db44553d6e513 change-id: 20241212-kbuild-deb-pkg-no-initrd-for-um-1c7b9ab2f264 Best regards,