Hello community,

here is the log from the commit of package mkinitrd for openSUSE:Factory 
checked in at 2012-10-19 08:47:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mkinitrd (Old)
 and      /work/SRC/openSUSE:Factory/.mkinitrd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mkinitrd", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/mkinitrd/mkinitrd.changes        2012-08-04 
09:22:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.mkinitrd.new/mkinitrd.changes   2012-10-19 
08:47:41.000000000 +0200
@@ -1,0 +2,12 @@
+Thu Oct 18 12:36:10 UTC 2012 - [email protected]
+
+- Add a new utility for running a command like diff or less on a
+  file in the initrd boot image 
+
+-------------------------------------------------------------------
+Tue Oct 16 13:46:06 UTC 2012 - [email protected]
+
+- Add 0001-Handle-lib-udev-being-a-symlink-to-usr-lib-udev.patch:
+  handle /lib/udev being a symlink.
+
+-------------------------------------------------------------------

New:
----
  0001-Handle-lib-udev-being-a-symlink-to-usr-lib-udev.patch
  mkinitrd-2.7.1-cmdinitrd.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mkinitrd.spec ++++++
--- /var/tmp/diff_new_pack.i5jS9P/_old  2012-10-19 08:47:43.000000000 +0200
+++ /var/tmp/diff_new_pack.i5jS9P/_new  2012-10-19 08:47:43.000000000 +0200
@@ -51,6 +51,10 @@
 Group:          System/Base
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        mkinitrd.tar.bz2
+# PATCH-FIX-UPSTREAM 
0001-Handle-lib-udev-being-a-symlink-to-usr-lib-udev.patch [email protected] -- 
handle /lib/udev being a symlink
+Patch0:         0001-Handle-lib-udev-being-a-symlink-to-usr-lib-udev.patch
+# PATCH-FIX-UPSTREAM mkinitrd-2.7.1-cmdinitrd.patch [email protected] -- add 
cmdinitrd to run commands on files in an initrd
+Patch1:         mkinitrd-2.7.1-cmdinitrd.patch
 # Note: the whole package is maintained in this git repository, please
 # don't change it in the build service without sending the author a
 # pull request or patch first. Otherwise, you risk that your changes will be
@@ -85,11 +89,14 @@
 
 %prep
 %setup
+%patch0 -p1
+%patch1 -p1
 
 %build
 %__cc $RPM_OPT_FLAGS -Wall -Os -o lib/mkinitrd/bin/run-init src/run-init.c
 %__cc $RPM_OPT_FLAGS -Wall -Os -o lib/mkinitrd/bin/warpclock src/warpclock.c
 make -C man
+make -C man cmdinitrd.8
 sed -i "s/@BUILD_DAY@/`env LC_ALL=C date -ud yesterday '+%Y%m%d'`/" 
sbin/mkinitrd
 echo "Checking scripts:"
 if ! bash -n sbin/mkinitrd; then
@@ -117,6 +124,7 @@
 install -D -m 644 man/mkinitrd.5 $RPM_BUILD_ROOT/%{_mandir}/man5/mkinitrd.5
 install -D -m 644 man/mkinitrd.8 $RPM_BUILD_ROOT/%{_mandir}/man8/mkinitrd.8
 install -D -m 644 man/lsinitrd.8 $RPM_BUILD_ROOT/%{_mandir}/man8/lsinitrd.8
+install -D -m 644 man/cmdinitrd.8 $RPM_BUILD_ROOT/%{_mandir}/man8/cmdinitrd.8
 mkdir -p $RPM_BUILD_ROOT/etc/rpm
 cat > $RPM_BUILD_ROOT/etc/rpm/macros.mkinitrd <<EOF
 #
@@ -178,6 +186,7 @@
 /lib/mkinitrd/scripts/*.sh
 /lib/mkinitrd/bin/*
 /bin/lsinitrd
+/bin/cmdinitrd
 /sbin/mkinitrd
 /sbin/mkinitrd_setup
 /sbin/module_upgrade
@@ -185,7 +194,8 @@
 /sbin/purge-kernels
 /var/adm/fillup-templates/sysconfig.kernel-%name
 %doc %{_mandir}/man5/mkinitrd.5.gz
-%doc %{_mandir}/man8/mkinitrd.8.gz
 %doc %{_mandir}/man8/lsinitrd.8.gz
+%doc %{_mandir}/man8/mkinitrd.8.gz
+%doc %{_mandir}/man8/cmdinitrd.8.gz
 
 %changelog

++++++ 0001-Handle-lib-udev-being-a-symlink-to-usr-lib-udev.patch ++++++
>From ceab9bc68cceaf924cd2abbec533bd2b9a1864bf Mon Sep 17 00:00:00 2001
From: Frederic Crozat <[email protected]>
Date: Fri, 5 Oct 2012 15:13:15 +0200
Subject: [PATCH] Handle /lib/udev being a symlink to /usr/lib/udev.
 Signed-off-by: Frederic Crozat <[email protected]>

---
 scripts/setup-udev.sh |   28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/scripts/setup-udev.sh b/scripts/setup-udev.sh
index c961b20..a9d5806 100644
--- a/scripts/setup-udev.sh
+++ b/scripts/setup-udev.sh
@@ -7,6 +7,21 @@
 # Default udev timeout is 30 seconds
 udev_timeout=30
 
+# copy helper
+if [ -d /usr/lib/udev ]; then
+    mkdir -p $tmp_mnt/usr/lib/udev $tmp_mnt/lib
+    ln -s -f ../usr/lib/udev $tmp_mnt/lib/udev
+else
+    mkdir -p $tmp_mnt/lib/udev
+fi
+for script in /usr/lib/udev/* /lib/udev/* /sbin/*_id ; do
+    if [ ! -d "$script" ] && [ -x "$script" ] ; then
+        cp_bin $script ${tmp_mnt}${script}
+    elif [ -f "$script" ] ; then
+        cp -pL $script ${tmp_mnt}${script}
+    fi
+done
+
 mkdir -p $tmp_mnt/lib/udev/rules.d
 mkdir -p $tmp_mnt/etc/udev/rules.d
 # copy needed rules
@@ -22,21 +37,14 @@ for rule in \
     64-md-raid.rules \
     79-kms.rules \
     80-drivers.rules; do
-    if [ -f /lib/udev/rules.d/$rule ]; then
+    if [ -f /usr/lib/udev/rules.d/$rule ]; then
+        cp /usr/lib/udev/rules.d/$rule $tmp_mnt/usr/lib/udev/rules.d
+    elif [ -f /lib/udev/rules.d/$rule ]; then
         cp /lib/udev/rules.d/$rule $tmp_mnt/lib/udev/rules.d
     elif [ -f /etc/udev/rules.d/$rule ]; then
         cp /etc/udev/rules.d/$rule $tmp_mnt/etc/udev/rules.d
     fi
 done
-# copy helper
-mkdir -p $tmp_mnt/lib/udev
-for script in /lib/udev/* /sbin/*_id ; do
-    if [ ! -d "$script" ] && [ -x "$script" ] ; then
-        cp_bin $script ${tmp_mnt}${script}
-    elif [ -f "$script" ] ; then
-        cp -pL $script ${tmp_mnt}${script}
-    fi
-done
 
 for bin in /sbin/blkid; do
     cp_bin $bin ${tmp_mnt}${bin}
-- 
1.7.10.4

++++++ mkinitrd-2.7.1-cmdinitrd.patch ++++++
>From ea43feb63547b4f5cd3bb65e24530fa3b2a91e6b Mon Sep 17 00:00:00 2001
From: Werner Fink <[email protected]>
Date: Thu, 18 Oct 2012 14:11:32 +0200
Subject: [PATCH] Add new utility cmdinitrd to run commands like less or diff
 on files of an initrd Signed-off-by: Werner Fink
 <[email protected]>

---
 man/Makefile        |    3 ++
 man/cmdinitrd.8.txt |   64 ++++++++++++++++++++++++++++++++++
 sbin/Makefile       |    2 +-
 sbin/cmdinitrd      |   96 +++++++++++++++++++++++++++++++++++++++++++++++++++
 sbin/lsinitrd       |   20 ++++++-----
 5 files changed, 175 insertions(+), 10 deletions(-)
 create mode 100644 man/cmdinitrd.8.txt
 create mode 100644 sbin/cmdinitrd

diff --git a/man/Makefile b/man/Makefile
index be1e73c..990c972 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -6,6 +6,9 @@ all: lsinitrd.8 mkinitrd.5 mkinitrd.8
 lsinitrd.8: lsinitrd.8.txt
        $(A2X) $(A2X_OPTIONS) $<
 
+cmdinitrd.8: cmdinitrd.8.txt
+       $(A2X) $(A2X_OPTIONS) $<
+
 mkinitrd.5: mkinitrd.5.txt
        $(A2X) $(A2X_OPTIONS) $<
 
diff --git a/man/cmdinitrd.8.txt b/man/cmdinitrd.8.txt
new file mode 100644
index 0000000..7fed535
--- /dev/null
+++ b/man/cmdinitrd.8.txt
@@ -0,0 +1,64 @@
+//{{{ Copyright (c) 2012, SUSE LINUX Products GmbH
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// Neither the name of the Novell nor the names of its contributors may be used
+// to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//}}}
+
+cmdinitrd(8)
+===========
+:man source: cmdinitrd
+:man manual: User Manuals
+Werner Fink <[email protected]>
+
+Name
+----
+cmdinitrd - run command on a file of an initrd disk image
+
+Synopsis
+--------
+cmdinitrd _initrd file_ _command_ [_options_] _file_ [_local file_]
+
+Description
+-----------
+*cmdinitrd*  executes a command on the content of a file of an initial ramdisk 
images for booting Linux as
+created by *mkinitrd*(8).
+
+Examples
+--------
+  cmdinitrd /boot/initrd diff -u etc/adjtime /etc/adjtime
+
+Authors
+-------
+Werner Fink <[email protected]>
+
+SEE ALSO
+--------
+*mkinitrd*(8), *mkinitrd*(5)
+
+
+// vim: set sw=4 ts=4 et tw=80 fdm=marker: :collapseFolds=1:
diff --git a/sbin/Makefile b/sbin/Makefile
index b2d1130..c648f46 100644
--- a/sbin/Makefile
+++ b/sbin/Makefile
@@ -6,7 +6,7 @@ sbindir = /sbin
 bindir = /bin
 
 PRGS = mkinitrd installkernel module_upgrade mkinitrd_setup purge-kernels
-UPRGS = lsinitrd
+UPRGS = lsinitrd cmdinitrd
 all: install
 install: install_prgs install_uprgs
 
diff --git a/sbin/cmdinitrd b/sbin/cmdinitrd
new file mode 100644
index 0000000..e07bf57
--- /dev/null
+++ b/sbin/cmdinitrd
@@ -0,0 +1,96 @@
+#!/bin/bash
+#
+# cmdinitrd - use command on contents of an initrd image
+#
+# Copyright (C) 2012 SuSE Linux Products GmbH, Nuernberg, Germany
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+# USA.
+
+# This file is kept in the following git repository:
+#
+# git://git.opensuse.org/projects/mkinitrd.git
+#
+
+usage() {
+    echo "Usage: cmdinitrd <initrd> <cmd> [<opt>] <file> [<local>]"
+}
+
+initrd="${1}"
+infile=
+typeset -a argv=()
+typeset -i argc=0
+shift
+
+while [ "$1" ] ; do
+    case $1 in
+        -*)
+           argv[$argc]="$1"
+           let argc++;
+           shift
+           ;;
+       *)  if ((argc == 0)) ; then
+                   argv[0]="$1"
+                   let argc++;
+                   shift
+           else
+                   infile="$1"
+                   shift
+                   break
+           fi
+    esac
+done
+
+if [ -z "$initrd" ] ; then
+    echo "No initrd file specified"
+    usage
+    exit 1
+fi
+
+if [ ! -e "$initrd" ] ; then
+    echo "No initrd file \`$initrd' found"
+    usage
+    exit 1
+fi
+
+if [ -z "$infile" ] ; then
+    echo "No file of the initrd image specified"
+    usage
+    exit 1
+fi
+
+if ! type -p ${argv[0]} &> /dev/null ; then
+    echo "No command \`${argv[0]}' found"
+    usage
+    exit 1
+fi
+
+uncomp()
+{
+       local uncompress="gzip"
+       case $(file -bL "$1") in
+       gzip\ *)    uncompress="gzip"   ;;
+       bzip2\ *)   uncompress="bzip2"  ;;
+       LZMA\ *)    uncompress="lzma"   ;;
+       XZ\ *)      uncompress="xz"     ;;
+       esac
+       command $uncompress -cdfq < "$1"
+}
+
+case "${argv[0]##*/}" in
+    diff)   test -n "$1" || set -- $infile ;;
+esac
+
+uncomp "$initrd" | exec cpio --quiet -i --to-stdout "${infile#/}" | exec 
${argv[@]} - ${1+"$@"}
diff --git a/sbin/lsinitrd b/sbin/lsinitrd
index 0c17458..e1cdefb 100755
--- a/sbin/lsinitrd
+++ b/sbin/lsinitrd
@@ -54,14 +54,16 @@ while [ "$1" ] ; do
     esac
 done
 
-use_gzip=true
 uncomp()
 {
-       if $use_gzip && gzip -cd "$1" 2>/dev/null; then
-               return
-       fi
-       use_gzip=false
-       xz -cd "$1"
+       local uncompress="gzip"
+       case $(file -bL "$1") in
+       gzip\ *)    uncompress="gzip"   ;;
+       bzip2\ *)   uncompress="bzip2"  ;;
+       LZMA\ *)    uncompress="lzma"   ;;
+       XZ\ *)      uncompress="xz"     ;;
+       esac
+       command $uncompress -cdfq < "$1"
 }
 
 
@@ -81,11 +83,11 @@ fi
 
 if [ "$config" -eq 1 ] ; then
     # yes, that's snow, but doesn't use any temporary files :)
-    for configfile in $(uncomp $initrd | cpio $args --quiet | grep '^config/') 
; do
+    for configfile in $(uncomp $initrd | exec cpio --quiet -t | exec grep 
'^config/') ; do
         echo "=========> $configfile <============"
-        uncomp $initrd | cpio --quiet -i --to-stdout $configfile
+        uncomp $initrd | exec cpio --quiet -i --to-stdout $configfile
         echo
     done
 else
-    uncomp $initrd | cpio --quiet $args
+    uncomp $initrd | exec cpio --quiet $args
 fi
-- 
1.7.9.2

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to