[oe] [meta-initramfs][PATCH 3/7 v2] dracut: Add execute_dracut opkg intercept script

Khem Raj raj.khem at gmail.com
Sun Mar 3 22:05:25 UTC 2019


On Tue, Feb 26, 2019 at 1:55 AM Böszörményi Zoltán <zboszor at pr.hu> wrote:
>
> Signed-off-by: Böszörményi Zoltán <zboszor at pr.hu>
> ---
> v2: The script name is execute_dracut, not execute-dracut
>     so it is identical to the postinst-intercepts variant.
>
>  .../dracut/dracut/execute_dracut              | 21 +++++++++++++++++++
>  .../recipes-devtools/dracut/dracut_git.bb     |  5 +++++
>  2 files changed, 26 insertions(+)
>  create mode 100755 meta-initramfs/recipes-devtools/dracut/dracut/execute_dracut
>
> diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/execute_dracut b/meta-initramfs/recipes-devtools/dracut/dracut/execute_dracut
> new file mode 100755
> index 000000000..96bcc92ed
> --- /dev/null
> +++ b/meta-initramfs/recipes-devtools/dracut/dracut/execute_dracut
> @@ -0,0 +1,21 @@
> +#!/bin/sh
> +
> +if [ ! -f $OPKG_INTERCEPT_DIR/execute-dracut ]; then
> +       KERNEL_VERSION=$1
> +       shift
> +       MY_KERNEL_VERSION=$(readlink /boot/bzimage | sed 's,^.*bzImage-,,')

this assumption breaks all image builds for qemux86 and qemux86_64
unless that is fixed, it will be hard to accept this series. bzImage
is not the kernel name always and may not be present in rootfs all the
time.

ERROR: yoe-simple-image-1.0-r0 do_rootfs: The postinstall intercept
hook 'execute_dracut' failed, details in
/mnt/a/yoe/build/tmp/work/qemux86-yoe-linux/yoe-s
imple-image/1.0-r0/temp/log.do_rootfs
ERROR: yoe-simple-image-1.0-r0 do_rootfs:
ERROR: yoe-simple-image-1.0-r0 do_rootfs: Function failed: do_rootfs



> +       if [[ -z "$MY_KERNEL_VERSION" ]]; then
> +               if [[ -d /lib/modules/$KERNEL_VERSION ]]; then
> +                       MY_KERNEL_VERSION="${KERNEL_VERSION}"
> +               fi
> +       fi
> +       [[ -z "$MY_KERNEL_VERSION" ]] && echo COULD NOT DETERMINE KERNEL VERSION TO RUN DEPMOD AND DRACUT && echo PLEASE DO IT MANUALLY && exit 0
> +       cat <<EOF > $OPKG_INTERCEPT_DIR/execute-dracut
> +echo RUNNING: depmod -a $MY_KERNEL_VERSION
> +depmod -a $MY_KERNEL_VERSION
> +echo RUNNING: dracut -f $@ /boot/initramfs.img $MY_KERNEL_VERSION
> +echo "dracut: $(dracut --help | grep 'Version:')"
> +dracut -f $@ /boot/initramfs.img $MY_KERNEL_VERSION
> +EOF
> +       chmod +x $OPKG_INTERCEPT_DIR/execute-dracut
> +fi
> diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
> index a1d7cb119..cb49d9539 100644
> --- a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
> +++ b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
> @@ -12,6 +12,7 @@ PV = "049"
>  SRCREV = "225e4b94cbdb702cf512490dcd2ad9ca5f5b22c1"
>  SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http \
>             file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
> +           file://execute_dracut \
>             "
>
>  DEPENDS += "kmod"
> @@ -49,11 +50,15 @@ do_install() {
>      # Its Makefile uses cp -arx to install modules.d, so fix the owner
>      # to root:root
>      chown -R root:root ${D}/${prefix}/lib/dracut/modules.d
> +
> +    install -d -m0755 ${D}${datadir}/opkg/intercept
> +    install -m0755 ${WORKDIR}/execute_dracut ${D}${datadir}/opkg/intercept
>  }
>
>  FILES_${PN} += "${prefix}/lib/kernel \
>                  ${prefix}/lib/dracut \
>                  ${systemd_unitdir} \
> +                ${datadir}/opkg/intercept \
>                 "
>  FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug"
>
> --
> 2.20.1
>


More information about the Openembedded-devel mailing list