[Ovirt-devel] [PATCH node-image] avoid image-minimizer fall-out

Jim Meyering jim at meyering.net
Wed Oct 8 13:08:50 UTC 2008


>From 8e45eb82fb7ed450de78e48aeaa8bd34b04313e1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Wed, 8 Oct 2008 14:59:31 +0200
Subject: [PATCH node-image] ovirt-node-image.ks (%post): Include common-post.ks last

I noticed the following error go by today:

    Removing blacklisted files and directories
    Cleanup empty directory structures in /usr/share
    Running image-minimizer...
==> Unknown Command: touch
    e2fsck 1.41.0 (10-Jul-2008)
    Pass 1: Checking inodes, blocks, and sizes

That's due to the new use of image-minimizer in common-post.ks (cool, btw!).
It appears at the end of that file:

    echo "Cleanup empty directory structures in /usr/share"
    find /usr/share -type d -exec rmdir {} \; > /dev/null 2>&1

    echo "Running image-minimizer..."
    %post --nochroot --interpreter image-minimizer
    drop /usr/lib/libboost*
    keep /usr/lib/libboost_program_options.so*
    keep /usr/lib/libboost_filesystem.so*
    drop /usr/lib64/libboost*
    keep /usr/lib64/libboost_program_options.so*
    keep /usr/lib64/libboost_filesystem.so*

However, common-post.ks is included from ovirt-node-image.ks like this:

    ...
    %post
    %include common-post.ks

    touch /.autorelabel

    %end

Which means the "touch" command is interpreted by image-minimizer.
Whoops.

The patch below fixes that by moving the "touch" to precede the
inclusion of common-post.ks:
---
 ovirt-node-image.ks |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ovirt-node-image.ks b/ovirt-node-image.ks
index f5695d8..36b5da9 100644
--- a/ovirt-node-image.ks
+++ b/ovirt-node-image.ks
@@ -8,10 +8,13 @@
 %end

 %post
-%include common-post.ks

 touch /.autorelabel

+%include common-post.ks
+# CAUTION: don't include anything between the inclusion of common-post.ks
+# and the "%end" directive below.  Since the tail of common-post.ks invokes
+# image-minimizer, anything here would be interpreted as commands to it.
 %end

 %post --nochroot
--
1.6.0.2.307.gc427




More information about the ovirt-devel mailing list