Skip to contentSkip to conversation

Run dracut from do_rootfs

PATCH Superseded Böszörményi Zoltán 2 participants 27 messages Feb 16, 2019 – Feb 20, 2019

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/6 cross-compiler-ldd: add new recipe

dracut runs ldd internally when discovering library dependencies for executables. cross-compiler-ldd is needed so dracut may eventually run while creating the rootfs.

---
 .../cross-compile-ldd-fix-infinite-loop.patch | 19 +++++++++++
 .../dracut/cross-compiler-ldd_git.bb          | 33 +++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd/cross-compile-ldd-fix-infinite-loop.patch
 create mode 100644 meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd_git.bb
meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd/cross-compile-ldd-fix-infinite-loop.patch new file +19 -0
new file mode 100644
index 000000000..4aae731d1
@@ -0,0 +1,19 @@
+diff --git a/cross-compile-ldd b/cross-compile-ldd
+index ef2ca20..332d57f 100644
+--- a/cross-compile-ldd
++++ b/cross-compile-ldd
+@@ -337,13 +337,13 @@ do_scan_etc_ldsoconf() {
+ # Build up the full list of search directories
+ declare -a needed_search_path
+ do_trace "Adding basic lib dirs\n"
+-ld_library_path="${ld_library_path}:"
+ while [ -n "${ld_library_path}" ]; do
+     d="${ld_library_path%%:*}"
+     if [ -n "${d}" ]; then
+         do_trace "-> adding search dir '%s'\n" "${d}"
+         needed_search_path+=( "${d}" )
+     fi
++    [[ "$ld_library_path" == "${ld_library_path#*:}" ]] && break
+     ld_library_path="${ld_library_path#*:}"
+ done
+ do_trace "Done adding basic lib dirs\n"
meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd_git.bb new file +33 -0
new file mode 100644
index 000000000..f8b7906ea
@@ -0,0 +1,33 @@
+SUMMARY = "Cross-compiler LDD"
+HOMEPAGE = "https://gist.github.com/c403786c1394f53f44a3b61214489e6f"
+BUGTRACKER = ""
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://cross-compile-ldd;beginline=53;endline=57;md5=2b29d19d18a430b931dda3750e865c84"
+
+SRCBRANCH = "master"
+SRCREV = "eb44581caf7dd60b149a6691abef46264c46e866"
+SRC_URI = " \
+			git://gist.github.com/c403786c1394f53f44a3b61214489e6f.git;protocol=https;branch=${SRCBRANCH} \
+			file://cross-compile-ldd-fix-infinite-loop.patch \
+		"
+
+S = "${WORKDIR}/git"
+
+inherit siteinfo
+
+SYSROOT_PREPROCESS_FUNCS += " cross_ldd_populate_sysroot "
+
+cross_ldd_populate_sysroot() {
+	mkdir -p ${SYSROOT_DESTDIR}${bindir_crossscripts}
+	cat ${S}/cross-compile-ldd | \
+		sed \
+			-e "s,^prefix=.*$,prefix=${TARGET_SYS}," \
+			-e "s,^bits=.*$,bits=${SITEINFO_BITS}," \
+			-e "s,^ld_library_path=.*$,ld_library_path=${LD_LIBRARY_PATH:-/lib:/usr/lib}," \
+		>${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
+	chmod +x ${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
+}
+
+DEPENDS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
+PACKAGE_WRITE_DEPS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/6 dracut: Allow native build

In reply to Böszörményi Zoltán

For useful modules to be successfully included into the initramfs, the dependencies must be extended.

---
 meta-initramfs/recipes-devtools/dracut/dracut_git.bb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +10 -2
index dd2e8bbb3..71926c3b8 100644
@@ -59,11 +59,19 @@ FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug"
 
 CONFFILES_${PN} += "${sysconfdir}/dracut.conf"
 
-RDEPENDS_${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
+RDEPENDS_${PN}_class-target = " \
+                     findutils cpio util-linux-blkid util-linux-getopt util-linux-losetup util-linux-umount util-linux \
+                     bash ldd xz plymouth-initrd kbd-consolefonts kbd-consoletrans kbd-keymaps kbd-unimaps gzip tar sed \
+                     openssh-scp openssh-ssh systemd udev linux-firmware \
+                    "
+RDEPENDS_${PN}_class-native = "coreutils-native findutils-native cpio-native util-linux-native bash-native cross-compiler-ldd"
 
 # This could be optimized a bit, but let's avoid non-booting systems :)
-RRECOMMENDS_${PN} = " \
+RRECOMMENDS_${PN}_class-target = " \
                      kernel-modules \
                      busybox \
                      coreutils \
+                     intel-microcode \
                     "
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.20.1
#3 lore raw

Re: [meta-initramfs][PATCH 2/6] dracut: Allow native build

Quoted 15 lines · Böszörményi Zoltán

For useful modules to be successfully included into the initramfs, the dependencies must be extended.

---
 meta-initramfs/recipes-devtools/dracut/dracut_git.bb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +0 -0
index dd2e8bbb3..71926c3b8 100644
@@ -59,11 +59,19 @@ FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug"
 

meta-initramfs/recipes-devtools/dracut/dracut_git.bb FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug" · line 68

Quoted 10 lines
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +6 -1
 CONFFILES_${PN} += "${sysconfdir}/dracut.conf"
 
-RDEPENDS_${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
+RDEPENDS_${PN}_class-target = " \
+                     findutils cpio util-linux-blkid util-linux-getopt util-linux-losetup util-linux-umount util-linux \
+                     bash ldd xz plymouth-initrd kbd-consolefonts kbd-consoletrans kbd-keymaps kbd-unimaps gzip tar sed \
+                     openssh-scp openssh-ssh systemd udev linux-firmware \
+                    "
+RDEPENDS_${PN}_class-native = "coreutils-native findutils-native cpio-native util-linux-native bash-native cross-compiler-ldd"
 

this adds unconditional dependency on systemd, if this is the case then we need to make it such that it does not get pulled into non systemd builds e.g. when using sysvinit

ERROR: Nothing RPROVIDES 'systemd' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
systemd was skipped: missing required distro feature 'systemd' (not in DISTRO_FEATURES)

Quoted 13 lines
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +4 -2
 # This could be optimized a bit, but let's avoid non-booting systems :)
-RRECOMMENDS_${PN} = " \
+RRECOMMENDS_${PN}_class-target = " \
                      kernel-modules \
                      busybox \
                      coreutils \
+                     intel-microcode \
                     "
+
+BBCLASSEXTEND = "native"
--

2.20.1

#4 lore raw

Re: [meta-initramfs][PATCH 2/6] dracut: Allow native build

2019. 02. 17. 21:40 keltezéssel, Khem Raj írta:

Quoted 18 lines · Böszörményi Zoltán
Quoted 17 lines

For useful modules to be successfully included into the initramfs, the dependencies must be extended.

---
  meta-initramfs/recipes-devtools/dracut/dracut_git.bb | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +0 -0
index dd2e8bbb3..71926c3b8 100644
@@ -59,11 +59,19 @@ FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug"
 
  CONFFILES_${PN} += "${sysconfdir}/dracut.conf"
 
Quoted 12 lines

meta-initramfs/recipes-devtools/dracut/dracut_git.bb FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug" · line 68

Quoted 8 lines
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +6 -1
-RDEPENDS_${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
+RDEPENDS_${PN}_class-target = " \
+                     findutils cpio util-linux-blkid util-linux-getopt util-linux-losetup util-linux-umount util-linux \
+                     bash ldd xz plymouth-initrd kbd-consolefonts kbd-consoletrans kbd-keymaps kbd-unimaps gzip tar sed \
+                     openssh-scp openssh-ssh systemd udev linux-firmware \
+                    "
+RDEPENDS_${PN}_class-native = "coreutils-native findutils-native cpio-native util-linux-native bash-native cross-compiler-ldd"
 

this adds unconditional dependency on systemd, if this is the case then we need to make it such that it does not get pulled into non systemd builds e.g. when using sysvinit

Thanks, I will fix it.

I will need to send a v2 patch for other patches in the series, so

1. allarch packages can also use dracut.bbclass, like script-only dracut module packages, and
2. for the s,execute-dracut,execute_dracut, change for the opkg intercept script name so its name is identical to the do_rootfs variant

As for (1), with such a package that uses "inherit allarch" but with dracut.bbclass depending on binutils-cross-${TUNE_ARCH} and gcc-cross-${TUNE_ARCH}, I get these warnings in Yocto 2.5 for an i686 target:

WARNING: sicom-pos-initramfs-1.24-r0 do_prepare_recipe_sysroot: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-binutils-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?
WARNING: sicom-pos-initramfs-1.24-r0 do_prepare_recipe_sysroot: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-gcc-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?
WARNING: sicom-pos-initramfs-1.24-r0 do_install: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-binutils-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?
WARNING: sicom-pos-initramfs-1.24-r0 do_install: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-gcc-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?
WARNING: sicom-pos-initramfs-1.24-r0 do_package: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-binutils-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?
WARNING: sicom-pos-initramfs-1.24-r0 do_package: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-gcc-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?
WARNING: sicom-pos-initramfs-1.24-r0 do_package_write_ipk: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-binutils-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?
WARNING: sicom-pos-initramfs-1.24-r0 do_package_write_ipk: Manifest /data/OE/sicom-manifest-2.5/build/tmp-sicom-glibc/sstate-control/manifest-x86_64_allarch-gcc-cross-i686.populate_sysroot not found in x86_64_allarch (variant '')?

Can it be worked around cleanly or are these warnings acceptable?

Quoted 23 lines

ERROR: Nothing RPROVIDES 'systemd' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
systemd was skipped: missing required distro feature 'systemd' (not in DISTRO_FEATURES)

Quoted 13 lines
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +4 -2
  # This could be optimized a bit, but let's avoid non-booting systems :)
-RRECOMMENDS_${PN} = " \
+RRECOMMENDS_${PN}_class-target = " \
                       kernel-modules \
                       busybox \
                       coreutils \
+                     intel-microcode \
                      "
+
+BBCLASSEXTEND = "native"
--

2.20.1

#5 lore raw

PATCH 3/6 dracut: Add execute-dracut opkg intercept script

In reply to Böszörményi Zoltán
---
 .../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
meta-initramfs/recipes-devtools/dracut/dracut/execute-dracut new file +21 -0
new file mode 100755
index 000000000..96bcc92ed
@@ -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-,,')
+	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
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +5 -0
index 71926c3b8..c3a0383ff 100644
@@ -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"
 
Signature · 1 line
2.20.1
#6 lore raw

PATCH 4/6 meta-initramfs: Add postinst-intercepts/execute_dracut script

In reply to Böszörményi Zoltán

So dracut can be triggered to run during do_rootfs.

---
 .../postinst-intercepts/execute_dracut          | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100755 meta-initramfs/postinst-intercepts/execute_dracut
meta-initramfs/postinst-intercepts/execute_dracut new file +17 -0
new file mode 100755
index 000000000..78d81a902
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+export \
+	prefix dracutsysrootdir \
+	systemdutildir systemdsystemunitdir systemdsystemconfdir udevdir \
+	DRACUT_ARCH DRACUT_TESTBIN DRACUT_LDD DRACUT_LDCONFIG \
+	DRACUT_COMPRESS_LZMA DRACUT_INSTALL DRACUT_INSTALL_PATH
+
+[[ -d $DRACUT_TMPDIR ]] || mkdir -p $DRACUT_TMPDIR
+
+echo RUNNING: depmod $DEPMODOPT -a $MY_KERNEL_VERSION
+depmod $DEPMODOPT -a $MY_KERNEL_VERSION
+echo "dracut: $(dracut --help | grep 'Version:')"
+echo RUNNING: dracut -f --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS $EXTRAOPTS $D/boot/initramfs.img $MY_KERNEL_VERSION
+dracut -f --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS $EXTRAOPTS $D/boot/initramfs.img $MY_KERNEL_VERSION
Signature · 1 line
2.20.1
#7 lore raw

PATCH 5/6 classes/dracut.bbclass: add new bbclass

In reply to Böszörményi Zoltán

dracut.bbclass can be used from kernel or other recipes, like custom dracut modules or plymouth boot splash themes.

---
 meta-initramfs/classes/dracut.bbclass | 82 +++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 meta-initramfs/classes/dracut.bbclass
meta-initramfs/classes/dracut.bbclass new file +82 -0
new file mode 100644
index 000000000..09e42d8c2
@@ -0,0 +1,82 @@
+DRACUT_PN ??= "${PN}"
+DRACUT_OPTS ??= "--early-microcode --lzma"
+
+python __anonymous () {
+    pkg = d.getVar("DRACUT_PN", True)
+    if pkg != 'dracut':
+        d.appendVar("RDEPENDS_%s" % pkg, " dracut ")
+    if not pkg.startswith('kernel'):
+        d.appendVarFlag("do_configure", "depends", "virtual/kernel:do_shared_workdir")
+        d.appendVarFlag("do_compile", "depends", "virtual/kernel:do_compile_kernelmodules")
+}
+
+export BUILD_TIME_KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
+
+dracut_postinst () {
+	MY_KERNEL_VERSION=$(readlink $D/boot/bzimage | sed 's,^.*bzImage-,,')
+	if [[ -z "$MY_KERNEL_VERSION" ]]; then
+		MY_KERNEL_VERSION="${KERNEL_VERSION}"
+	fi
+	if [[ -z "$MY_KERNEL_VERSION" ]]; then
+		MY_KERNEL_VERSION="${BUILD_TIME_KERNEL_VERSION}"
+	fi
+	if [[ -z "$MY_KERNEL_VERSION" ]]; then
+		exit 1
+	fi
+
+	if [ -n "$D" ]; then
+		#DEBUGOPTS="--debug --keep"
+		DEBUGOPTS="--keep"
+
+		# We have to unset "prefix" as dracut uses it to move files around.
+		# Yocto has it set as part of the build environment.
+		$INTERCEPT_DIR/postinst_intercept execute_dracut ${PKG} mlprefix=${MLPREFIX} \
+			prefix= \
+			MY_KERNEL_VERSION=$MY_KERNEL_VERSION \
+			DEPMODOPT="\"-b $D\"" \
+			dracutsysrootdir=$D \
+			DEBUGOPTS="\"$DEBUGOPTS\"" \
+			DRACUT_OPTS="\"${DRACUT_OPTS}\"" \
+			EXTRAOPTS="\"-k $D/lib/modules/$MY_KERNEL_VERSION\"" \
+			systemdutildir=${systemd_unitdir} \
+			systemdsystemunitdir=${systemd_system_unitdir} \
+			systemdsystemconfdir=/etc/systemd/system \
+			udevdir=/usr/lib/udev \
+			DRACUT_TMPDIR=${WORKDIR}/dracut-tmpdir \
+			DRACUT_ARCH="${TUNE_ARCH}" \
+			DRACUT_TESTBIN=/bin/bash.bash \
+			DRACUT_COMPRESS_LZMA=$NATIVE_ROOT/usr/bin/lzma \
+			DRACUT_LDD="\"PATH='$PATH' ${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
+			DRACUT_LDCONFIG=$NATIVE_ROOT/usr/bin/ldconfig \
+			DRACUT_INSTALL="\"$NATIVE_ROOT/usr/lib/dracut/dracut-install\"" \
+			DRACUT_INSTALL_PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+	else
+		execute_dracut $MY_KERNEL_VERSION ${DRACUT_OPTS}
+	fi
+}
+
+dracut_populate_packages[vardeps] += "dracut_postinst"
+
+python dracut_populate_packages() {
+    localdata = d.createCopy()
+
+    pkg = d.getVar('DRACUT_PN', True)
+
+    postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+    if not postinst:
+        postinst = '#!/bin/sh\n'
+    postinst += localdata.getVar('dracut_postinst', True)
+    d.setVar('pkg_postinst_%s' % pkg, postinst)
+}
+
+PACKAGESPLITFUNCS_prepend = "dracut_populate_packages "
+
+DRACUT_DEPENDS = " \
+			binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH} \
+			ldconfig-native coreutils-native findutils-native \
+			cpio-native util-linux-native kmod-native xz-native \
+			dracut-native pkgconfig-native cross-compiler-ldd \
+			systemd \
+		"
+DEPENDS_append_class-target = " ${DRACUT_DEPENDS}"
+PACKAGE_WRITE_DEPS_append = " ${DRACUT_DEPENDS}"
Signature · 1 line
2.20.1
#8 lore raw

PATCH 6/6 dracut: use the code that allows running under do_rootfs

In reply to Böszörményi Zoltán
---
 meta-initramfs/recipes-devtools/dracut/dracut_git.bb | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +6 -4
index c3a0383ff..5c32176d7 100644
@@ -6,11 +6,13 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 PE = "1"
-PV = "049"
+PV = "050"
+PR = "r0.alpha.rootfs"
 
-# v048 tag
-SRCREV = "225e4b94cbdb702cf512490dcd2ad9ca5f5b22c1"
-SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http \
+# v049 tag plus run from a rootfs
+SRCBRANCH = "allow-separate-rootfs"
+SRCREV = "6fe40f64f923e61e17c9d3db06cf9bfe6e83a68a"
+SRC_URI = "git://github.com/zboszor/dracut.git;protocol=https;branch=${SRCBRANCH} \
            file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
            file://execute-dracut \
            "
Signature · 1 line
2.20.1
#10 lore raw

PATCH 1/6 cross-compiler-ldd: add new recipe

dracut runs ldd internally when discovering library dependencies for executables. cross-compiler-ldd is needed so dracut may eventually run while creating the rootfs.

---
 .../cross-compile-ldd-fix-infinite-loop.patch | 19 +++++++++++
 .../dracut/cross-compiler-ldd_git.bb          | 33 +++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd/cross-compile-ldd-fix-infinite-loop.patch
 create mode 100644 meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd_git.bb
meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd/cross-compile-ldd-fix-infinite-loop.patch new file +19 -0
new file mode 100644
index 000000000..4aae731d1
@@ -0,0 +1,19 @@
+diff --git a/cross-compile-ldd b/cross-compile-ldd
+index ef2ca20..332d57f 100644
+--- a/cross-compile-ldd
++++ b/cross-compile-ldd
+@@ -337,13 +337,13 @@ do_scan_etc_ldsoconf() {
+ # Build up the full list of search directories
+ declare -a needed_search_path
+ do_trace "Adding basic lib dirs\n"
+-ld_library_path="${ld_library_path}:"
+ while [ -n "${ld_library_path}" ]; do
+     d="${ld_library_path%%:*}"
+     if [ -n "${d}" ]; then
+         do_trace "-> adding search dir '%s'\n" "${d}"
+         needed_search_path+=( "${d}" )
+     fi
++    [[ "$ld_library_path" == "${ld_library_path#*:}" ]] && break
+     ld_library_path="${ld_library_path#*:}"
+ done
+ do_trace "Done adding basic lib dirs\n"
meta-initramfs/recipes-devtools/dracut/cross-compiler-ldd_git.bb new file +33 -0
new file mode 100644
index 000000000..f8b7906ea
@@ -0,0 +1,33 @@
+SUMMARY = "Cross-compiler LDD"
+HOMEPAGE = "https://gist.github.com/c403786c1394f53f44a3b61214489e6f"
+BUGTRACKER = ""
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://cross-compile-ldd;beginline=53;endline=57;md5=2b29d19d18a430b931dda3750e865c84"
+
+SRCBRANCH = "master"
+SRCREV = "eb44581caf7dd60b149a6691abef46264c46e866"
+SRC_URI = " \
+			git://gist.github.com/c403786c1394f53f44a3b61214489e6f.git;protocol=https;branch=${SRCBRANCH} \
+			file://cross-compile-ldd-fix-infinite-loop.patch \
+		"
+
+S = "${WORKDIR}/git"
+
+inherit siteinfo
+
+SYSROOT_PREPROCESS_FUNCS += " cross_ldd_populate_sysroot "
+
+cross_ldd_populate_sysroot() {
+	mkdir -p ${SYSROOT_DESTDIR}${bindir_crossscripts}
+	cat ${S}/cross-compile-ldd | \
+		sed \
+			-e "s,^prefix=.*$,prefix=${TARGET_SYS}," \
+			-e "s,^bits=.*$,bits=${SITEINFO_BITS}," \
+			-e "s,^ld_library_path=.*$,ld_library_path=${LD_LIBRARY_PATH:-/lib:/usr/lib}," \
+		>${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
+	chmod +x ${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
+}
+
+DEPENDS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
+PACKAGE_WRITE_DEPS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
Signature · 1 line
2.20.1
#11 lore raw

PATCH v2 2/6 dracut: Allow native build

In reply to Böszörményi Zoltán

For useful modules to be successfully included into the initramfs, the dependencies must be extended.

---
v2: Only RDEPEND on systemd if DISTRO_FEATURES has it.

 .../recipes-devtools/dracut/dracut_git.bb           | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +11 -2
index dd2e8bbb3..aad3c68bf 100644
@@ -59,11 +59,20 @@ FILES_${PN}-dbg += "${prefix}/lib/dracut/.debug"
 
 CONFFILES_${PN} += "${sysconfdir}/dracut.conf"
 
-RDEPENDS_${PN} = "findutils cpio util-linux-blkid util-linux-getopt util-linux bash ldd"
+RDEPENDS_${PN}_class-target = " \
+                     findutils cpio util-linux-blkid util-linux-getopt util-linux-losetup util-linux-umount util-linux \
+                     bash ldd xz plymouth-initrd kbd-consolefonts kbd-consoletrans kbd-keymaps kbd-unimaps gzip tar sed \
+                     openssh-scp openssh-ssh linux-firmware \
+                     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+                    "
+RDEPENDS_${PN}_class-native = "coreutils-native findutils-native cpio-native util-linux-native bash-native cross-compiler-ldd"
 
 # This could be optimized a bit, but let's avoid non-booting systems :)
-RRECOMMENDS_${PN} = " \
+RRECOMMENDS_${PN}_class-target = " \
                      kernel-modules \
                      busybox \
                      coreutils \
+                     intel-microcode \
                     "
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.20.1
#12 lore raw

PATCH v2 3/6 dracut: Add execute_dracut opkg intercept script

In reply to Böszörményi Zoltán

---
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
meta-initramfs/recipes-devtools/dracut/dracut/execute_dracut new file +21 -0
new file mode 100755
index 000000000..96bcc92ed
@@ -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-,,')
+	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
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +5 -0
index aad3c68bf..dd94ac598 100644
@@ -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"
 
Signature · 1 line
2.20.1
#13 lore raw

PATCH 4/6 meta-initramfs: Add postinst-intercepts/execute_dracut

In reply to Böszörményi Zoltán

So dracut can be triggered to run during do_rootfs.

---
 .../postinst-intercepts/execute_dracut          | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100755 meta-initramfs/postinst-intercepts/execute_dracut
meta-initramfs/postinst-intercepts/execute_dracut new file +17 -0
new file mode 100755
index 000000000..78d81a902
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+export \
+	prefix dracutsysrootdir \
+	systemdutildir systemdsystemunitdir systemdsystemconfdir udevdir \
+	DRACUT_ARCH DRACUT_TESTBIN DRACUT_LDD DRACUT_LDCONFIG \
+	DRACUT_COMPRESS_LZMA DRACUT_INSTALL DRACUT_INSTALL_PATH
+
+[[ -d $DRACUT_TMPDIR ]] || mkdir -p $DRACUT_TMPDIR
+
+echo RUNNING: depmod $DEPMODOPT -a $MY_KERNEL_VERSION
+depmod $DEPMODOPT -a $MY_KERNEL_VERSION
+echo "dracut: $(dracut --help | grep 'Version:')"
+echo RUNNING: dracut -f --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS $EXTRAOPTS $D/boot/initramfs.img $MY_KERNEL_VERSION
+dracut -f --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS $EXTRAOPTS $D/boot/initramfs.img $MY_KERNEL_VERSION
Signature · 1 line
2.20.1
#14 lore raw

PATCH v2 5/6 classes/dracut.bbclass: add new bbclass

In reply to Böszörményi Zoltán

dracut.bbclass can be used from kernel or other recipes, like custom dracut modules or plymouth boot splash themes.

---
v2: Use ${TUNE_ARCH} so allarch packages can use this bbclass

 meta-initramfs/classes/dracut.bbclass | 82 +++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 meta-initramfs/classes/dracut.bbclass
meta-initramfs/classes/dracut.bbclass new file +82 -0
new file mode 100644
index 000000000..3c1421df8
@@ -0,0 +1,82 @@
+DRACUT_PN ??= "${PN}"
+DRACUT_OPTS ??= "--early-microcode --lzma"
+
+python __anonymous () {
+    pkg = d.getVar("DRACUT_PN", True)
+    if pkg != 'dracut':
+        d.appendVar("RDEPENDS_%s" % pkg, " dracut ")
+    if not pkg.startswith('kernel'):
+        d.appendVarFlag("do_configure", "depends", "virtual/kernel:do_shared_workdir")
+        d.appendVarFlag("do_compile", "depends", "virtual/kernel:do_compile_kernelmodules")
+}
+
+export BUILD_TIME_KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
+
+dracut_postinst () {
+	MY_KERNEL_VERSION=$(readlink $D/boot/bzimage | sed 's,^.*bzImage-,,')
+	if [[ -z "$MY_KERNEL_VERSION" ]]; then
+		MY_KERNEL_VERSION="${KERNEL_VERSION}"
+	fi
+	if [[ -z "$MY_KERNEL_VERSION" ]]; then
+		MY_KERNEL_VERSION="${BUILD_TIME_KERNEL_VERSION}"
+	fi
+	if [[ -z "$MY_KERNEL_VERSION" ]]; then
+		exit 1
+	fi
+
+	if [ -n "$D" ]; then
+		#DEBUGOPTS="--debug --keep"
+		DEBUGOPTS="--keep"
+
+		# We have to unset "prefix" as dracut uses it to move files around.
+		# Yocto has it set as part of the build environment.
+		$INTERCEPT_DIR/postinst_intercept execute_dracut ${PKG} mlprefix=${MLPREFIX} \
+			prefix= \
+			MY_KERNEL_VERSION=$MY_KERNEL_VERSION \
+			DEPMODOPT="\"-b $D\"" \
+			dracutsysrootdir=$D \
+			DEBUGOPTS="\"$DEBUGOPTS\"" \
+			DRACUT_OPTS="\"${DRACUT_OPTS}\"" \
+			EXTRAOPTS="\"-k $D/lib/modules/$MY_KERNEL_VERSION\"" \
+			systemdutildir=${systemd_unitdir} \
+			systemdsystemunitdir=${systemd_system_unitdir} \
+			systemdsystemconfdir=/etc/systemd/system \
+			udevdir=/usr/lib/udev \
+			DRACUT_TMPDIR=${WORKDIR}/dracut-tmpdir \
+			DRACUT_ARCH="${TUNE_ARCH}" \
+			DRACUT_TESTBIN=/bin/bash.bash \
+			DRACUT_COMPRESS_LZMA=$NATIVE_ROOT/usr/bin/lzma \
+			DRACUT_LDD="\"PATH='$PATH' ${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
+			DRACUT_LDCONFIG=$NATIVE_ROOT/usr/bin/ldconfig \
+			DRACUT_INSTALL="\"$NATIVE_ROOT/usr/lib/dracut/dracut-install\"" \
+			DRACUT_INSTALL_PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+	else
+		execute_dracut $MY_KERNEL_VERSION ${DRACUT_OPTS}
+	fi
+}
+
+dracut_populate_packages[vardeps] += "dracut_postinst"
+
+python dracut_populate_packages() {
+    localdata = d.createCopy()
+
+    pkg = d.getVar('DRACUT_PN', True)
+
+    postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+    if not postinst:
+        postinst = '#!/bin/sh\n'
+    postinst += localdata.getVar('dracut_postinst', True)
+    d.setVar('pkg_postinst_%s' % pkg, postinst)
+}
+
+PACKAGESPLITFUNCS_prepend = "dracut_populate_packages "
+
+DRACUT_DEPENDS = " \
+			binutils-cross-${TUNE_ARCH} gcc-cross-${TUNE_ARCH} \
+			ldconfig-native coreutils-native findutils-native \
+			cpio-native util-linux-native kmod-native xz-native \
+			dracut-native pkgconfig-native cross-compiler-ldd \
+			systemd \
+		"
+DEPENDS_append_class-target = " ${DRACUT_DEPENDS}"
+PACKAGE_WRITE_DEPS_append = " ${DRACUT_DEPENDS}"
Signature · 1 line
2.20.1
#15 lore raw

PATCH 6/6 dracut: use the code that allows running under do_rootfs

In reply to Böszörményi Zoltán
---
 meta-initramfs/recipes-devtools/dracut/dracut_git.bb | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meta-initramfs/recipes-devtools/dracut/dracut_git.bb +6 -4
index dd94ac598..a148dc83f 100644
@@ -6,11 +6,13 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 PE = "1"
-PV = "049"
+PV = "050"
+PR = "r0.alpha.rootfs"
 
-# v048 tag
-SRCREV = "225e4b94cbdb702cf512490dcd2ad9ca5f5b22c1"
-SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http \
+# v049 tag plus run from a rootfs
+SRCBRANCH = "allow-separate-rootfs"
+SRCREV = "6fe40f64f923e61e17c9d3db06cf9bfe6e83a68a"
+SRC_URI = "git://github.com/zboszor/dracut.git;protocol=https;branch=${SRCBRANCH} \
            file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \
            file://execute_dracut \
            "
Signature · 1 line
2.20.1
#16 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

In reply to Böszörményi Zoltán

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#17 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

more here

NOTE: Started PRServer with DBfile: /mnt/a/yoe/cache/prserv.sqlite3,
IP: 127.0.0.1, PORT: 45089, PID: 43331
Parsing recipes...done.
Parsing of 3233 .bb files complete (0 cached, 3233 parsed). 4441
targets, 574 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'plymouth-initrd' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'plymouth-initrd' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['plymouth-initrd']
NOTE: Runtime target 'dracut' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut', 'plymouth-initrd']
NOTE: Runtime target 'dracut-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut-dev', 'plymouth-initrd']
ERROR: Nothing RPROVIDES 'intel-microcode' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'intel-microcode' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['intel-microcode']

Build Configuration:

BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "arch"
TARGET_SYS           = "arm-yoe-linux-musleabi"
MACHINE              = "sama5d27-som1-ek-sd"
DISTRO               = "yoe-musl-sysvinit-wayland"
DISTRO_VERSION       = "2.6"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta-yoe             = "yoe/mut:f14a20d6c6b23391aa0b8636d0b20752e074830a"
meta-96boards        = "HEAD:6e8a11ea878698742e83832ef06df2c11604c338"
meta-atmel           = "HEAD:ac803d348433d7755803f5429c7c40f4883a5ae4"
meta-freescale       = "HEAD:2e83203ebd8439a45bc7a931ace6871e6b238658"
meta-freescale-3rdparty = "HEAD:8b38f230d4d7cd6c283d75c17eddfbe51eca90a5"
meta-odroid
meta-odroid-extras   = "yoe/mut:688ff9c5f549f072af204ee64d5ad3ee18b9e47f"
meta-qcom            = "yoe/mut:f708a3a9b6a61cd4d83a32dec4532453a127b54a"
meta-raspberrypi     = "HEAD:6305aa7b693fb3423bd40921144666dadd7185b8"
meta-riscv           = "yoe/mut:2ec848f8f37ea3c0d3538f32a59133294a9234cc"
meta-ti              = "yoe/mut:04c4fef39d62396ea855b5f086a969269d740562"
meta-browser         = "yoe/mut:974e22e9ffcba92a1d7e7aab90a6cb88b9c3e77f"
meta-qt5             = "HEAD:fb71293f257c6fd02ccc06765a96dbf11d4569a0"
meta-rust            = "HEAD:f4517aaba8026b44576c6407adf0175663d5a7b4"

meta-filesystems
meta-gnome
meta-initramfs
meta-multimedia
meta-networking
meta-oe
meta-perl
meta-python
meta-webserver

meta-xfce            = "yoe/mut:6adca5007190518de21ff406a141944c9d601588"
meta                 = "yoe/mut:36242003ab8ff7e5dd93206ff672d92f9dbbd6e4"
meta-clang           = "master:e96a34778c238692769c488fbe0d7781f0b929ce"
workspace            = "kraj/master:8a94ccf193a33feb1546455fd190ac880ff66fb2"
Quoted 15 lines · Khem Raj

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#18 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

2019. 02. 19. 8:14 keltezéssel, Khem Raj írta:

Quoted 12 lines

more here

NOTE: Started PRServer with DBfile: /mnt/a/yoe/cache/prserv.sqlite3,
IP: 127.0.0.1, PORT: 45089, PID: 43331
Parsing recipes...done.
Parsing of 3233 .bb files complete (0 cached, 3233 parsed). 4441
targets, 574 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'plymouth-initrd' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'plymouth-initrd' is unbuildable, removing...

Questions:

1. What removes "initrd" from the plymouth PACKAGECONFIG for this setup?

2. Can a PACKAGECONFIG string of one recipe queried from another recipe? E.g. would bb.utils.contains("PACKAGECONFIG_pn-plymouth", ...) work from the dracut recipe if the variable does not exit at a layer level but only in a plymouth bbappend?

3. Would moving plymouth-initrd from RDEPENDS to RRECOMMENDS in the dracut recipe solve this problem? If not, why? intel-microcode is also in RRECOMMENDS, but it's mentioned in the errors below. Why?

Quoted 66 lines

Missing or unbuildable dependency chain was: ['plymouth-initrd']
NOTE: Runtime target 'dracut' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut', 'plymouth-initrd']
NOTE: Runtime target 'dracut-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut-dev', 'plymouth-initrd']
ERROR: Nothing RPROVIDES 'intel-microcode' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'intel-microcode' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['intel-microcode']

Build Configuration:

BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "arch"
TARGET_SYS           = "arm-yoe-linux-musleabi"
MACHINE              = "sama5d27-som1-ek-sd"
DISTRO               = "yoe-musl-sysvinit-wayland"
DISTRO_VERSION       = "2.6"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta-yoe             = "yoe/mut:f14a20d6c6b23391aa0b8636d0b20752e074830a"
meta-96boards        = "HEAD:6e8a11ea878698742e83832ef06df2c11604c338"
meta-atmel           = "HEAD:ac803d348433d7755803f5429c7c40f4883a5ae4"
meta-freescale       = "HEAD:2e83203ebd8439a45bc7a931ace6871e6b238658"
meta-freescale-3rdparty = "HEAD:8b38f230d4d7cd6c283d75c17eddfbe51eca90a5"
meta-odroid
meta-odroid-extras   = "yoe/mut:688ff9c5f549f072af204ee64d5ad3ee18b9e47f"
meta-qcom            = "yoe/mut:f708a3a9b6a61cd4d83a32dec4532453a127b54a"
meta-raspberrypi     = "HEAD:6305aa7b693fb3423bd40921144666dadd7185b8"
meta-riscv           = "yoe/mut:2ec848f8f37ea3c0d3538f32a59133294a9234cc"
meta-ti              = "yoe/mut:04c4fef39d62396ea855b5f086a969269d740562"
meta-browser         = "yoe/mut:974e22e9ffcba92a1d7e7aab90a6cb88b9c3e77f"
meta-qt5             = "HEAD:fb71293f257c6fd02ccc06765a96dbf11d4569a0"
meta-rust            = "HEAD:f4517aaba8026b44576c6407adf0175663d5a7b4"

meta-filesystems
meta-gnome
meta-initramfs
meta-multimedia
meta-networking
meta-oe
meta-perl
meta-python
meta-webserver

meta-xfce            = "yoe/mut:6adca5007190518de21ff406a141944c9d601588"
meta                 = "yoe/mut:36242003ab8ff7e5dd93206ff672d92f9dbbd6e4"
meta-clang           = "master:e96a34778c238692769c488fbe0d7781f0b929ce"
workspace            = "kraj/master:8a94ccf193a33feb1546455fd190ac880ff66fb2"
Quoted 15 lines · Khem Raj

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#19 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

Quoted 22 lines · Böszörményi Zoltán

2019. 02. 19. 8:14 keltezéssel, Khem Raj írta:

Quoted 12 lines

more here

NOTE: Started PRServer with DBfile: /mnt/a/yoe/cache/prserv.sqlite3,
IP: 127.0.0.1, PORT: 45089, PID: 43331
Parsing recipes...done.
Parsing of 3233 .bb files complete (0 cached, 3233 parsed). 4441
targets, 574 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'plymouth-initrd' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'plymouth-initrd' is unbuildable, removing...

Questions:

1. What removes "initrd" from the plymouth PACKAGECONFIG for this setup?

Quoted 4 lines

2. Can a PACKAGECONFIG string of one recipe queried from another recipe? E.g. would bb.utils.contains("PACKAGECONFIG_pn-plymouth", ...) work from the dracut recipe if the variable does not exit at a layer level but only in a plymouth bbappend?

I dont think so, but you can tie it into a DISTRO_CONFIG

Quoted 4 lines

3. Would moving plymouth-initrd from RDEPENDS to RRECOMMENDS in the dracut recipe solve this problem? If not, why? intel-microcode is also in RRECOMMENDS, but it's mentioned in the errors below. Why?

recommendations still have to be built, for feeds.

Quoted 68 lines
Quoted 67 lines

Missing or unbuildable dependency chain was: ['plymouth-initrd']
NOTE: Runtime target 'dracut' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut', 'plymouth-initrd']
NOTE: Runtime target 'dracut-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut-dev', 'plymouth-initrd']
ERROR: Nothing RPROVIDES 'intel-microcode' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'intel-microcode' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['intel-microcode']

Build Configuration:

BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "arch"
TARGET_SYS           = "arm-yoe-linux-musleabi"
MACHINE              = "sama5d27-som1-ek-sd"
DISTRO               = "yoe-musl-sysvinit-wayland"
DISTRO_VERSION       = "2.6"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta-yoe             = "yoe/mut:f14a20d6c6b23391aa0b8636d0b20752e074830a"
meta-96boards        = "HEAD:6e8a11ea878698742e83832ef06df2c11604c338"
meta-atmel           = "HEAD:ac803d348433d7755803f5429c7c40f4883a5ae4"
meta-freescale       = "HEAD:2e83203ebd8439a45bc7a931ace6871e6b238658"
meta-freescale-3rdparty = "HEAD:8b38f230d4d7cd6c283d75c17eddfbe51eca90a5"
meta-odroid
meta-odroid-extras   = "yoe/mut:688ff9c5f549f072af204ee64d5ad3ee18b9e47f"
meta-qcom            = "yoe/mut:f708a3a9b6a61cd4d83a32dec4532453a127b54a"
meta-raspberrypi     = "HEAD:6305aa7b693fb3423bd40921144666dadd7185b8"
meta-riscv           = "yoe/mut:2ec848f8f37ea3c0d3538f32a59133294a9234cc"
meta-ti              = "yoe/mut:04c4fef39d62396ea855b5f086a969269d740562"
meta-browser         = "yoe/mut:974e22e9ffcba92a1d7e7aab90a6cb88b9c3e77f"
meta-qt5             = "HEAD:fb71293f257c6fd02ccc06765a96dbf11d4569a0"
meta-rust            = "HEAD:f4517aaba8026b44576c6407adf0175663d5a7b4"

meta-filesystems
meta-gnome
meta-initramfs
meta-multimedia
meta-networking
meta-oe
meta-perl
meta-python
meta-webserver

meta-xfce            = "yoe/mut:6adca5007190518de21ff406a141944c9d601588"
meta                 = "yoe/mut:36242003ab8ff7e5dd93206ff672d92f9dbbd6e4"
meta-clang           = "master:e96a34778c238692769c488fbe0d7781f0b929ce"
workspace            = "kraj/master:8a94ccf193a33feb1546455fd190ac880ff66fb2"
Quoted 15 lines · Khem Raj

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#20 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

2019. 02. 19. 17:51 keltezéssel, Khem Raj írta:

Quoted 23 lines · Böszörményi Zoltán
Quoted 19 lines

2019. 02. 19. 8:14 keltezéssel, Khem Raj írta:

Quoted 12 lines

more here

NOTE: Started PRServer with DBfile: /mnt/a/yoe/cache/prserv.sqlite3,
IP: 127.0.0.1, PORT: 45089, PID: 43331
Parsing recipes...done.
Parsing of 3233 .bb files complete (0 cached, 3233 parsed). 4441
targets, 574 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'plymouth-initrd' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'plymouth-initrd' is unbuildable, removing...

Questions:

1. What removes "initrd" from the plymouth PACKAGECONFIG for this setup?

Quoted 6 lines
Quoted 4 lines

2. Can a PACKAGECONFIG string of one recipe queried from another recipe? E.g. would bb.utils.contains("PACKAGECONFIG_pn-plymouth", ...) work from the dracut recipe if the variable does not exit at a layer level but only in a plymouth bbappend?

I dont think so, but you can tie it into a DISTRO_CONFIG

You mean, instead of checking for PACKAGECONFIG, plymouth and dracut should both test for "dracut" in DISTRO_FEATURES, right?

Or should they check for the other one?

Or both should check for both strings?

Which one is preferred?

Quoted 7 lines
Quoted 5 lines

3. Would moving plymouth-initrd from RDEPENDS to RRECOMMENDS in the dracut recipe solve this problem? If not, why? intel-microcode is also in RRECOMMENDS, but it's mentioned in the errors below. Why?

recommendations still have to be built, for feeds.

Okay, so I need a function to check for an x86(_64) target and conditionally include intel-microcode.

Quoted 70 lines
Quoted 69 lines
Quoted 68 lines

Missing or unbuildable dependency chain was: ['plymouth-initrd']
NOTE: Runtime target 'dracut' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut', 'plymouth-initrd']
NOTE: Runtime target 'dracut-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut-dev', 'plymouth-initrd']
ERROR: Nothing RPROVIDES 'intel-microcode' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'intel-microcode' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['intel-microcode']

Build Configuration:

BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "arch"
TARGET_SYS           = "arm-yoe-linux-musleabi"
MACHINE              = "sama5d27-som1-ek-sd"
DISTRO               = "yoe-musl-sysvinit-wayland"
DISTRO_VERSION       = "2.6"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta-yoe             = "yoe/mut:f14a20d6c6b23391aa0b8636d0b20752e074830a"
meta-96boards        = "HEAD:6e8a11ea878698742e83832ef06df2c11604c338"
meta-atmel           = "HEAD:ac803d348433d7755803f5429c7c40f4883a5ae4"
meta-freescale       = "HEAD:2e83203ebd8439a45bc7a931ace6871e6b238658"
meta-freescale-3rdparty = "HEAD:8b38f230d4d7cd6c283d75c17eddfbe51eca90a5"
meta-odroid
meta-odroid-extras   = "yoe/mut:688ff9c5f549f072af204ee64d5ad3ee18b9e47f"
meta-qcom            = "yoe/mut:f708a3a9b6a61cd4d83a32dec4532453a127b54a"
meta-raspberrypi     = "HEAD:6305aa7b693fb3423bd40921144666dadd7185b8"
meta-riscv           = "yoe/mut:2ec848f8f37ea3c0d3538f32a59133294a9234cc"
meta-ti              = "yoe/mut:04c4fef39d62396ea855b5f086a969269d740562"
meta-browser         = "yoe/mut:974e22e9ffcba92a1d7e7aab90a6cb88b9c3e77f"
meta-qt5             = "HEAD:fb71293f257c6fd02ccc06765a96dbf11d4569a0"
meta-rust            = "HEAD:f4517aaba8026b44576c6407adf0175663d5a7b4"

meta-filesystems
meta-gnome
meta-initramfs
meta-multimedia
meta-networking
meta-oe
meta-perl
meta-python
meta-webserver

meta-xfce            = "yoe/mut:6adca5007190518de21ff406a141944c9d601588"
meta                 = "yoe/mut:36242003ab8ff7e5dd93206ff672d92f9dbbd6e4"
meta-clang           = "master:e96a34778c238692769c488fbe0d7781f0b929ce"
workspace            = "kraj/master:8a94ccf193a33feb1546455fd190ac880ff66fb2"
Quoted 15 lines · Khem Raj

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#21 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

Quoted 32 lines · Böszörményi Zoltán

2019. 02. 19. 17:51 keltezéssel, Khem Raj írta:

Quoted 23 lines · Böszörményi Zoltán
Quoted 19 lines

2019. 02. 19. 8:14 keltezéssel, Khem Raj írta:

Quoted 12 lines

more here

NOTE: Started PRServer with DBfile: /mnt/a/yoe/cache/prserv.sqlite3,
IP: 127.0.0.1, PORT: 45089, PID: 43331
Parsing recipes...done.
Parsing of 3233 .bb files complete (0 cached, 3233 parsed). 4441
targets, 574 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'plymouth-initrd' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'plymouth-initrd' is unbuildable, removing...

Questions:

1. What removes "initrd" from the plymouth PACKAGECONFIG for this setup?

Quoted 6 lines
Quoted 4 lines

2. Can a PACKAGECONFIG string of one recipe queried from another recipe? E.g. would bb.utils.contains("PACKAGECONFIG_pn-plymouth", ...) work from the dracut recipe if the variable does not exit at a layer level but only in a plymouth bbappend?

I dont think so, but you can tie it into a DISTRO_CONFIG

Quoted 8 lines

You mean, instead of checking for PACKAGECONFIG, plymouth and dracut should both test for "dracut" in DISTRO_FEATURES, right?

Or should they check for the other one?

Or both should check for both strings?

Which one is preferred?

just a DISTRO_FEATURE should be enough.

Quoted 11 lines
Quoted 8 lines
Quoted 6 lines

3. Would moving plymouth-initrd from RDEPENDS to RRECOMMENDS in the dracut recipe solve this problem? If not, why? intel-microcode is also in RRECOMMENDS, but it's mentioned in the errors below. Why?

recommendations still have to be built, for feeds.

Okay, so I need a function to check for an x86(_64) target and conditionally include intel-microcode.

I guess that would work, you might use overrides to add conditional dependency based on architecture.

Quoted 72 lines
Quoted 71 lines
Quoted 70 lines
Quoted 69 lines

Missing or unbuildable dependency chain was: ['plymouth-initrd']
NOTE: Runtime target 'dracut' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut', 'plymouth-initrd']
NOTE: Runtime target 'dracut-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['dracut-dev', 'plymouth-initrd']
ERROR: Nothing RPROVIDES 'intel-microcode' (but /mnt/a/yoe/sources/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'intel-microcode' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['intel-microcode']

Build Configuration:

BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "arch"
TARGET_SYS           = "arm-yoe-linux-musleabi"
MACHINE              = "sama5d27-som1-ek-sd"
DISTRO               = "yoe-musl-sysvinit-wayland"
DISTRO_VERSION       = "2.6"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta-yoe             = "yoe/mut:f14a20d6c6b23391aa0b8636d0b20752e074830a"
meta-96boards        = "HEAD:6e8a11ea878698742e83832ef06df2c11604c338"
meta-atmel           = "HEAD:ac803d348433d7755803f5429c7c40f4883a5ae4"
meta-freescale       = "HEAD:2e83203ebd8439a45bc7a931ace6871e6b238658"
meta-freescale-3rdparty = "HEAD:8b38f230d4d7cd6c283d75c17eddfbe51eca90a5"
meta-odroid
meta-odroid-extras   = "yoe/mut:688ff9c5f549f072af204ee64d5ad3ee18b9e47f"
meta-qcom            = "yoe/mut:f708a3a9b6a61cd4d83a32dec4532453a127b54a"
meta-raspberrypi     = "HEAD:6305aa7b693fb3423bd40921144666dadd7185b8"
meta-riscv           = "yoe/mut:2ec848f8f37ea3c0d3538f32a59133294a9234cc"
meta-ti              = "yoe/mut:04c4fef39d62396ea855b5f086a969269d740562"
meta-browser         = "yoe/mut:974e22e9ffcba92a1d7e7aab90a6cb88b9c3e77f"
meta-qt5             = "HEAD:fb71293f257c6fd02ccc06765a96dbf11d4569a0"
meta-rust            = "HEAD:f4517aaba8026b44576c6407adf0175663d5a7b4"

meta-filesystems
meta-gnome
meta-initramfs
meta-multimedia
meta-networking
meta-oe
meta-perl
meta-python
meta-webserver

meta-xfce            = "yoe/mut:6adca5007190518de21ff406a141944c9d601588"
meta                 = "yoe/mut:36242003ab8ff7e5dd93206ff672d92f9dbbd6e4"
meta-clang           = "master:e96a34778c238692769c488fbe0d7781f0b929ce"
workspace            = "kraj/master:8a94ccf193a33feb1546455fd190ac880ff66fb2"
Quoted 15 lines · Khem Raj

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#22 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

In reply to Khem Raj

2019. 02. 19. 8:01 keltezéssel, Khem Raj írta:

Quoted 1 line

https://errors.yoctoproject.org/Errors/Details/228793/

Since the log.do_rootfs is not too verbose, can you please share the contents of ${WORKDIR}/intercept_scripts*/execute_dracut ?

Or just grep for DRACUT_TMPDIR in that script.

This variable should be passed from dracut.bbclass and the same set of scripts do work under Yocto 2.5.

Thanks.

Quoted 14 lines · Böszörményi Zoltán
Quoted 11 lines

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#23 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

Ping.

2019. 02. 19. 9:16 keltezéssel, Böszörményi Zoltán via Openembedded-devel írta:

Quoted 28 lines

2019. 02. 19. 8:01 keltezéssel, Khem Raj írta:

Quoted 1 line

https://errors.yoctoproject.org/Errors/Details/228793/

Since the log.do_rootfs is not too verbose, can you please share the contents of ${WORKDIR}/intercept_scripts*/execute_dracut ?

Or just grep for DRACUT_TMPDIR in that script.

This variable should be passed from dracut.bbclass and the same set of scripts do work under Yocto 2.5.

Thanks.

Quoted 14 lines · Böszörményi Zoltán
Quoted 11 lines

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#24 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

In reply to Khem Raj

Please fix the author for my patches in Patchwork and in GIT history.

Who is this William A. Kennington III who claimed ownership over my patches?

2019. 02. 19. 8:01 keltezéssel, Khem Raj írta:

Quoted 15 lines

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#25 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

Quoted 2 lines · Böszörményi Zoltán

Please fix the author for my patches in Patchwork and in GIT history.

Don't worry, I am aware of this problem, and I will fix that once that patches are in good shape.
you should enquire your email provider also on this issue since it might also be related to them.

Quoted 20 lines

Who is this William A. Kennington III who claimed ownership over my patches?

2019. 02. 19. 8:01 keltezéssel, Khem Raj írta:

Quoted 15 lines

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi

#26 lore raw

Re: [meta-initramfs][PATCH 0/6 v2] Run dracut from rootfs

2019. 02. 19. 17:46 keltezéssel, Khem Raj írta:

Quoted 8 lines · Böszörményi Zoltán
Quoted 2 lines

Please fix the author for my patches in Patchwork and in GIT history.

Don't worry, I am aware of this problem, and I will fix that once that patches are in good shape.
you should enquire your email provider also on this issue since it might also be related to them.

I think it's more likely caused by that I have not had a patchwork account when I sent the patches and it assigned some bad default.

Quoted 22 lines
Quoted 21 lines

Who is this William A. Kennington III who claimed ownership over my patches?

2019. 02. 19. 8:01 keltezéssel, Khem Raj írta:

Quoted 15 lines

https://errors.yoctoproject.org/Errors/Details/228793/

Quoted 11 lines · Böszörményi Zoltán

This patchset adds the necessary pieces to create the initramfs with dracut during do_rootfs.

The 6th patch references a GitHub branch for which a pull request was made against dracut. See https://github.com/dracutdevs/dracut/pull/535

Best regards,
Zoltán Böszörményi