[oe] [meta-initramfs][PATCH 3/6] dracut: Add execute-dracut opkg intercept script
Böszörményi Zoltán
zboszor at pr.hu
Sat Feb 16 17:03:51 UTC 2019
Signed-off-by: Böszörményi Zoltán <zboszor at pr.hu>
---
.../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-,,')
+ 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 71926c3b8..c3a0383ff 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