[node-patches] Change in ovirt-node[ovirt-3.5]: Update the recipes to move modified initrds out

fabiand at redhat.com fabiand at redhat.com
Wed Dec 3 16:18:48 UTC 2014


Hello Ryan Barry,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/35844

to review the following change.

Change subject: Update the recipes to move modified initrds out
......................................................................

Update the recipes to move modified initrds out

Move dracut creation out of common-post so distro-specific
changes can go in without running dracut multiple times.

Pass the right kernel version into dracut so we don't pick up
whatever `uname -r` is in koji, brew, or other build
environments.

livecd-creator copies the initrd out before post script runs, so
move it out ourselves when we're done to pick up updates.

Change-Id: I3da516d2b29c1adde28811c5b47da1199385b70e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1152948
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M configure.ac
M recipe/common-nochroot.ks
M recipe/common-post.ks
A recipe/dracut-post.ks.in
M recipe/ovirt-node-image.ks.in
M recipe/ovirt19-post.ks
M recipe/rhevh7-post.ks
7 files changed, 15 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/44/35844/1

diff --git a/configure.ac b/configure.ac
index b179e29..554126a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,6 +67,10 @@
 AC_SUBST([SEMODULE_WITH_SYSTEMD])
 AC_SUBST([SEMODULE_NOT_EL6])
 
+AM_COND_IF([TARGET_SYSTEMD],
+    [DRACUT_ARGS="-f --kver"], [DRACUT_ARGS="-f ''"])
+AC_SUBST([DRACUT_ARGS])
+
 AM_COND_IF([TARGET_NEW_DRACUT],
      [DRACUTDIR="/usr/lib/dracut/modules.d"], [DRACUTDIR="/usr/share/dracut/modules.d"])
 AC_SUBST([DRACUTDIR])
@@ -124,6 +128,7 @@
                 tests/Makefile
                 $MAIN_KS
                 recipe/common-install.ks
+                recipe/dracut-post.ks
                 recipe/image-minimizer.ks
                 scripts/ovirt-functions
                 scripts/ovirt-init-functions.sh
diff --git a/recipe/common-nochroot.ks b/recipe/common-nochroot.ks
index f9ee49b..e3c324e 100644
--- a/recipe/common-nochroot.ks
+++ b/recipe/common-nochroot.ks
@@ -1,6 +1,9 @@
 
 %include version.ks
 
+echo "Copying the initrd out..."
+cp $INSTALL_ROOT/boot/*.img $LIVE_ROOT/isolinux/initrd0.img
+
 if [ -f "ovirt-authorized_keys" ]; then
   echo "Adding authorized_keys to Image"
   mkdir -p $INSTALL_ROOT/root/.ssh
diff --git a/recipe/common-post.ks b/recipe/common-post.ks
index 1da8bcb..0ed6f1a 100644
--- a/recipe/common-post.ks
+++ b/recipe/common-post.ks
@@ -289,8 +289,5 @@
 
 python -m compileall /usr/lib/python2.*/site-packages/sos
 
-echo "Regenerating initramfs"
-dracut -f || :
-
 # https://bugzilla.redhat.com/show_bug.cgi?id=1168582
 rm -vf /usr/lib64/python2.*/site-packages/backports/*
diff --git a/recipe/dracut-post.ks.in b/recipe/dracut-post.ks.in
new file mode 100644
index 0000000..9c0a999
--- /dev/null
+++ b/recipe/dracut-post.ks.in
@@ -0,0 +1,4 @@
+echo
+echo "Regenerating initramfs"
+echo `rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}" kernel`
+dracut @DRACUT_ARGS@ `rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}" kernel` || :
diff --git a/recipe/ovirt-node-image.ks.in b/recipe/ovirt-node-image.ks.in
index d1903ad..591a3ea 100644
--- a/recipe/ovirt-node-image.ks.in
+++ b/recipe/ovirt-node-image.ks.in
@@ -14,6 +14,7 @@
 %post
 %include common-post.ks
 %include @DISTRO at -post.ks
+%include dracut-post.ks
 %end
 
 %post --nochroot
diff --git a/recipe/ovirt19-post.ks b/recipe/ovirt19-post.ks
index 0aa923e..0097412 100644
--- a/recipe/ovirt19-post.ks
+++ b/recipe/ovirt19-post.ks
@@ -24,7 +24,7 @@
 # dracut config
 cat <<_EOF_ > /etc/dracut.conf.d/ovirt-node.conf
 
-add_dracutmodules+="dmsquash-live"
+add_dracutmodules+=" dmsquash-live "
 
 _EOF_
 
diff --git a/recipe/rhevh7-post.ks b/recipe/rhevh7-post.ks
index 92140e1..477a904 100644
--- a/recipe/rhevh7-post.ks
+++ b/recipe/rhevh7-post.ks
@@ -197,7 +197,7 @@
 # dracut config
 cat <<_EOF_ > /etc/dracut.conf.d/ovirt-node.conf
 
-add_dracutmodules+="dmsquash-live"
+add_dracutmodules+=" dmsquash-live "
 
 _EOF_
 


-- 
To view, visit http://gerrit.ovirt.org/35844
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3da516d2b29c1adde28811c5b47da1199385b70e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list