Hello community,
here is the log from the commit of package mkinitrd for openSUSE:Factory
checked in at Thu Dec 4 12:58:15 CET 2008.
--------
--- mkinitrd/mkinitrd.changes 2008-12-02 15:07:24.000000000 +0100
+++ /mounts/work_src_done/STABLE/mkinitrd/mkinitrd.changes 2008-12-03 19:58:08.000000000 +0100
@@ -1,0 +2,20 @@
+Wed Dec 03 19:57:23 CET 2008 - bwalle@suse.de
+
+- Add 'SUSE INITRD foo REQUIRES bar' comment parsing (bnc #449853).
+- Don't filter out install lines from initrd (bnc #449853).
+
+-------------------------------------------------------------------
+Wed Dec 03 19:56:38 CET 2008 - hare@suse.de
+
+- Copy persistent net rules into the initrd
+- Fixup ip= line to reflect interface changes from the commandline
+ (bnc #442074).
+
+-------------------------------------------------------------------
+Tue Dec 02 17:41:44 CET 2008 - bwalle@suse.de
+
+- Don't evaluate 'install' lines in /etc/modprobe.conf and friends
+ to generate module dependencies. Don't copy over install lines
+ into the initrd. (bnc #449123)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ mkinitrd.spec ++++++
--- /var/tmp/diff_new_pack.zNJ534/_old 2008-12-04 12:57:51.000000000 +0100
+++ /var/tmp/diff_new_pack.zNJ534/_new 2008-12-04 12:57:51.000000000 +0100
@@ -25,7 +25,7 @@
Requires: coreutils modutils util-linux grep gzip sed cpio udev sysvinit file perl-Bootloader
AutoReqProv: on
Version: 2.4
-Release: 35
+Release: 36
Conflicts: udev < 118
Requires: dhcpcd
Summary: Creates an Initial RAM Disk Image for Preloading Modules
@@ -122,6 +122,17 @@
%doc %{_mandir}/man8/lsinitrd.8.gz
%changelog
+* Wed Dec 03 2008 bwalle@suse.de
+- Add 'SUSE INITRD foo REQUIRES bar' comment parsing (bnc #449853).
+- Don't filter out install lines from initrd (bnc #449853).
+* Wed Dec 03 2008 hare@suse.de
+- Copy persistent net rules into the initrd
+- Fixup ip= line to reflect interface changes from the commandline
+ (bnc #442074).
+* Tue Dec 02 2008 bwalle@suse.de
+- Don't evaluate 'install' lines in /etc/modprobe.conf and friends
+ to generate module dependencies. Don't copy over install lines
+ into the initrd. (bnc #449123)
* Tue Dec 02 2008 bwalle@suse.de
- Change evaluation of -v option: Now it's really global, not local
to the subshell spawned by mkinitrd. Discovered while debugging
++++++ mkinitrd.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.4/man/lsinitrd.8 new/mkinitrd-2.4/man/lsinitrd.8
--- old/mkinitrd-2.4/man/lsinitrd.8 2008-12-02 15:05:55.000000000 +0100
+++ new/mkinitrd-2.4/man/lsinitrd.8 2008-12-03 19:57:59.000000000 +0100
@@ -38,5 +38,5 @@
.BR
.SH AUTHORS
-Hannes Reinecke , Alexander Graf
+Hannes Reinecke , Alexander Graf , Bernhard Walle
.BR
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.4/man/mkinitrd.5 new/mkinitrd-2.4/man/mkinitrd.5
--- old/mkinitrd-2.4/man/mkinitrd.5 2008-12-02 15:05:55.000000000 +0100
+++ new/mkinitrd-2.4/man/mkinitrd.5 2008-12-03 19:57:59.000000000 +0100
@@ -224,7 +224,7 @@
.SH AUTHORS
Steffen Winterfeldt , Susanne Oberhauser
, Andreas Gruenbacher , Hannes Reinecke
-, Alexander Graf
+, Alexander Graf , Bernhard Walle
.SH FILES
.PP
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.4/man/mkinitrd.8 new/mkinitrd-2.4/man/mkinitrd.8
--- old/mkinitrd-2.4/man/mkinitrd.8 2008-12-02 15:05:55.000000000 +0100
+++ new/mkinitrd-2.4/man/mkinitrd.8 2008-12-03 19:57:59.000000000 +0100
@@ -278,5 +278,5 @@
.SH AUTHOR
Steffen Winterfeldt , Susanne Oberhauser
, Andreas Gruenbacher , Hannes Reinecke
-, Alexander Graf
+, Alexander Graf , Bernhard Walle
.BR
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.4/mkinitrd.changes new/mkinitrd-2.4/mkinitrd.changes
--- old/mkinitrd-2.4/mkinitrd.changes 2008-12-02 15:05:55.000000000 +0100
+++ new/mkinitrd-2.4/mkinitrd.changes 2008-12-03 19:57:59.000000000 +0100
@@ -1,4 +1,24 @@
-------------------------------------------------------------------
+Wed Dec 03 19:57:23 CET 2008 - bwalle@suse.de
+
+- Add 'SUSE INITRD foo REQUIRES bar' comment parsing (bnc #449853).
+- Don't filter out install lines from initrd (bnc #449853).
+
+-------------------------------------------------------------------
+Wed Dec 03 19:56:38 CET 2008 - hare@suse.de
+
+- Copy persistent net rules into the initrd
+- Fixup ip= line to reflect interface changes from the commandline
+ (bnc #442074).
+
+-------------------------------------------------------------------
+Tue Dec 02 17:41:44 CET 2008 - bwalle@suse.de
+
+- Don't evaluate 'install' lines in /etc/modprobe.conf and friends
+ to generate module dependencies. Don't copy over install lines
+ into the initrd. (bnc #449123)
+
+-------------------------------------------------------------------
Tue Dec 02 15:04:59 CET 2008 - bwalle@suse.de
- Change evaluation of -v option: Now it's really global, not local
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.4/scripts/boot-network.sh new/mkinitrd-2.4/scripts/boot-network.sh
--- old/mkinitrd-2.4/scripts/boot-network.sh 2008-12-02 15:05:55.000000000 +0100
+++ new/mkinitrd-2.4/scripts/boot-network.sh 2008-12-03 19:57:59.000000000 +0100
@@ -33,7 +33,6 @@
if [ "$ip" ] ; then
nettype=${ip##*:}
ip=${ip%:*}
- interface=${ip##*:}
tmpip=${ip%:*}
ip="${tmpip}:${interface}:${nettype}"
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.4/scripts/setup-modules.sh new/mkinitrd-2.4/scripts/setup-modules.sh
--- old/mkinitrd-2.4/scripts/setup-modules.sh 2008-12-02 15:05:55.000000000 +0100
+++ new/mkinitrd-2.4/scripts/setup-modules.sh 2008-12-03 19:57:59.000000000 +0100
@@ -5,6 +5,11 @@
# TODO: generate module deps and copy them to the initrd
# take xen into account
+# Global variables
+# Array that stores additional dependencies. Each entry looks like
+# module:module1 module2
+declare -a additional_module_dependencies
+
# Check if module $1 is listed in $modules.
has_module() {
case " $modules " in
@@ -44,8 +49,8 @@
# the kernel and then just loads the kernel module, we can safely include
# such modules on such systems in initrd.
#
-# The check is done by checking if 'ext3.ko' is supported. Since we
-# have to supported ext3 for a very long period of time from now because
+# The check is done by checking if 'ipv6.ko' is supported. Since we
+# have to supported ipv6 for a very long period of time from now because
# it's our standard file system, and that module exists on every
# architecture and does not depend on the hardware and even exists in
# the base package of the kernel because we need it in a virtualised
@@ -63,7 +68,7 @@
local kernel_version=$1
local output=
- output=$(modinfo -k "$kernel_version" -F supported ext3 2>/dev/null)
+ output=$(modinfo -k "$kernel_version" -F supported ipv6 2>/dev/null)
if [ "$?" -ne 0 ] ; then
# If the command existed with an error, assume that the kernel is
# supported. That is just the same behaviour as before we did that
@@ -82,6 +87,127 @@
fi
}
+# Brief
+# Loads additional dependencies information
+#
+# Description
+# In /etc/modprobe.conf, /etc/modprobe.conf.local and /etc/modprobe.d/*
+# we have a special syntax
+#
+# # SUSE INITRD: foo REQUIRES bar
+#
+# to introduce additional dependencies which are expressed in the install
+# lines but cannot be parsed by mkinitrd statically.
+#
+# This function loads that dependencies into the global
+# additional_module_dependencies array.
+load_additional_dependencies()
+{
+ # array already filled
+ if [ ${#additional_module_dependencies[*]} -ne 0 ] ; then
+ return
+ fi
+
+ for file in /etc/modprobe.conf \
+ /etc/modprobe.conf.local \
+ /etc/modprobe.d/* ; do
+ # skip files if it does not exist
+ if ! [ -r "$file" ] ; then
+ continue
+ fi
+
+ while read line ; do
+ local string module requirement dependencies dependency
+
+ string=${line##*SUSE INITRD: }
+ module=${string/ REQUIRES*}
+ requirement=${string##*REQUIRES }
+
+ if [ -z "$module" -o -z "$requirement" ] ; then
+ echo >&2 "Requirement line '$line' in file '$file' is invalid."
+ continue
+ fi
+
+ number=0
+ added=0
+ for entry in ${additional_module_dependencies[@]} ; do
+ local module2 requirements2 val
+ module2=${entry/:*}
+ requirements2=${entry/*:}
+ if [ "$module2" = "$module" ] ; then
+ added=1
+ val="$module:$requirements2 $requirement"
+ additional_module_dependencies[$number]=$val
+ break
+ fi
+ number=$[number+1]
+ done
+
+ if [ $added -eq 0 ] ; then
+ additional_module_dependencies=( \
+ "${additional_module_dependencies[@]}" \
+ "$module:$requirement" )
+ fi
+ done < <(grep '^# SUSE INITRD: ' $file)
+ done
+}
+
+# Brief
+# Returns additional module requirements from
+# additional_module_dependencies
+#
+# Description
+# Checks for a given kernel modules if there are additional dependencies
+# found by load_additional_dependencies.
+#
+# Prints a list (separated by ' ') of modules if there are additional
+# dependencies.
+#
+# Parameters
+# mod: the module for which additional depdencies should be found
+# ver: the kernel version
+# recursive: recursive call if 1, don't print the final newline
+#
+# Return value
+# 0 (true) if there are additional dependencies, 1 (false) otherwise
+get_add_module_deps()
+{
+ local mod=${1##*/}
+ local version=$2
+ local recursive=$3
+ local printed=0
+ mod=${mod%.ko}
+
+ for entry in "${additional_module_dependencies[@]}" ; do
+ local module requirements m
+
+ module=${entry/:*}
+ requirements=${entry/*:}
+ if [ "$module" = "$mod" ] ; then
+ for m in $requirements ; do
+ filename=$(modinfo -k "$version" -F filename $m)
+ if [ -z "$filename" ] ; then
+ echo >&2 "Ignoring additional requirement $mod REQUIRES $m"
+ else
+ echo -n "$filename "
+ get_add_module_deps "$m" "$version" 1
+ printed=$[printed+1]
+ fi
+ done
+ fi
+ done
+
+ # build the return value
+ if [ $printed -ne 0 ] ; then
+ if [ "$recursive" -ne 1 ] ; then
+ echo ""
+ fi
+ return 0
+ fi
+
+ return 1
+}
+
# Resolve module dependencies and parameters. Returns a list of modules and
# their parameters.
resolve_modules() {
@@ -96,21 +222,12 @@
fi
for module in "$@"; do
- local with_modprobe_conf
module=${module%.o} # strip trailing ".o" just in case.
module=${module%.ko} # strip trailing ".ko" just in case.
- if [ -e /etc/modprobe.conf ]; then
- with_modprobe_conf="-C /etc/modprobe.conf"
- fi
- case "$module" in
- mpt*)
- if [ -f /etc/modprobe.d/mptctl ] ; then
- rm -f $tmp_mnt/etc/modprobe.d/mptctl
- mv /etc/modprobe.d/mptctl /tmp
- fi
- ;;
- esac
- module_list=$(/sbin/modprobe $with_modprobe_conf \
+
+ # don't use a modprobe.conf to get rid of the install lines
+ module_list=$(/sbin/modprobe \
+ -C /dev/null \
--set-version $kernel_version --ignore-install \
--show-depends $module \
$additional_args \
@@ -122,11 +239,21 @@
for mod in $module_list ; do
if ! $(echo $resolved_modules | grep -q $mod) ; then
resolved_modules="$resolved_modules $mod"
+
+ # check for additional requirements specified by
+ # SUSE INITRD comments in /etc/modprobe.conf{,local,.d/*}
+ additional_reqs=$(get_add_module_deps "$mod" "$kernel_version" 0)
+ if [ $? -eq 0 ] ; then
+ local req
+
+ for req in $additional_reqs ; do
+ if ! $(echo $resolved_modules | grep -q $req) ; then
+ resolved_modules="$resolved_modules $req"
+ fi
+ done
+ fi
fi
done
- if [ -f /tmp/mptctl ] ; then
- mv /tmp/mptctl /etc/modprobe.d/mptctl
- fi
done
echo $resolved_modules
}
@@ -152,6 +279,8 @@
fi
done
+# parsing of '# SUSE INITRD' lines
+load_additional_dependencies
resolved_modules="$(resolve_modules $kernel_version $modules)"
if [ $? -ne 0 ] ; then
return 1
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.4/scripts/setup-network.sh new/mkinitrd-2.4/scripts/setup-network.sh
--- old/mkinitrd-2.4/scripts/setup-network.sh 2008-12-02 15:05:55.000000000 +0100
+++ new/mkinitrd-2.4/scripts/setup-network.sh 2008-12-03 19:57:59.000000000 +0100
@@ -200,7 +200,10 @@
mkdir -p $tmp_mnt/var/lib/dhcpcd
mkdir -p $tmp_mnt/var/run
-cp_bin $root_dir/lib/mkinitrd/bin/ipconfig.sh $tmp_mnt/bin/ipconfig
+cp_bin /lib/mkinitrd/bin/ipconfig.sh $tmp_mnt/bin/ipconfig
+if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then
+ cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d
+fi
[ "$interface" ] && verbose "[NETWORK]\t$interface ($nettype)"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org