Hello community, here is the log from the commit of package mkinitrd checked in at Thu Apr 3 10:50:10 CEST 2008. -------- --- mkinitrd/mkinitrd.changes 2008-03-10 02:46:24.000000000 +0100 +++ /mounts/work_src_done/STABLE/mkinitrd/mkinitrd.changes 2008-04-01 15:08:00.000000000 +0200 @@ -1,0 +2,12 @@ +Tue Apr 1 15:03:02 CEST 2008 - hare@suse.de + +- Cleanup save_var statements +- Match network interface by MAC address +- Update multipath handling +- add CIFS support +- Move device discovery scripts +- Use wait_for_events function instead of udevsettle +- Update udev scripts to latest upstream version +- Bump version number to 2.2 + +------------------------------------------------------------------- @@ -4 +16 @@ -- Work on non-modular systems, too (bnc#367269) +- Work on non-modular systems, too (#367269) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mkinitrd.spec ++++++ --- /var/tmp/diff_new_pack.M29772/_old 2008-04-03 10:49:34.000000000 +0200 +++ /var/tmp/diff_new_pack.M29772/_new 2008-04-03 10:49:34.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package mkinitrd (Version 2.1) +# spec file for package mkinitrd (Version 2.2) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -18,8 +18,8 @@ #!BuildIgnore: module-init-tools e2fsprogs udev pciutils reiserfs Requires: coreutils modutils util-linux grep gzip sed gawk cpio udev pciutils sysvinit file perl AutoReqProv: on -Version: 2.1 -Release: 64 +Version: 2.2 +Release: 1 Summary: Creates an Initial RAM Disk Image for Preloading Modules BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: mkinitrd.tgz @@ -103,8 +103,17 @@ %doc %{_mandir}/man8/mkinitrd.8.gz %changelog +* Tue Apr 01 2008 hare@suse.de +- Cleanup save_var statements +- Match network interface by MAC address +- Update multipath handling +- add CIFS support +- Move device discovery scripts +- Use wait_for_events function instead of udevsettle +- Update udev scripts to latest upstream version +- Bump version number to 2.2 * Wed Mar 05 2008 hare@suse.de -- Work on non-modular systems, too (bnc#367269) +- Work on non-modular systems, too (#367269) * Wed Feb 06 2008 agraf@suse.de - don't resolve non-existing devices, so a wrong resume device option does not result in a broken initrd (#357725) @@ -302,9 +311,9 @@ - fix lib/lib64 detection on ia64/alpha * Fri Jan 19 2007 hare@suse.de - Obey settings from /etc/sysconfig/bootsplash (#230839) -* Fri Nov 24 2006 olh@suse.de +* Sat Nov 25 2006 olh@suse.de - declare variables as local in udev_discover_root/udev_discover_resume -* Fri Nov 24 2006 olh@suse.de +* Sat Nov 25 2006 olh@suse.de - nfsroot must be passed as root=server:/directory, either via cmdline or fstab. Just *:* as rootdev match string does not mean nfsroot, it will also trigger for /dev/disk/ symlinks @@ -413,13 +422,13 @@ - add code to detect if system time is older than build time * Thu Aug 24 2006 olh@suse.de - remove udev version requirement to keep mkinitrd sles10 compatible -* Wed Aug 23 2006 olh@suse.de +* Thu Aug 24 2006 olh@suse.de - remove static binary handling. ash can not deal with added array usage and static module-init-tools are larger than shared ones. -* Wed Aug 23 2006 olh@suse.de +* Thu Aug 24 2006 olh@suse.de - remove readlink function, binary exists since 8.2 and it breaks syntax highlighting in vim -* Wed Aug 23 2006 olh@suse.de +* Thu Aug 24 2006 olh@suse.de - remove special handling for init args, use the kernel provided args * Fri Aug 11 2006 fink@suse.de - Run blogd within initramfs @@ -686,7 +695,7 @@ * Fri Sep 02 2005 kasievers@suse.de - read DEV_ON_TMPFS from /etc/sysconfig/kernel (#114400) with default yes. -* Sat Aug 27 2005 cthiel@suse.de +* Sun Aug 28 2005 cthiel@suse.de - Fix splash size autodetection (#113573) * Fri Aug 26 2005 hare@suse.de - Add modprobe and modules.dep for proper handling of modules @@ -726,7 +735,7 @@ - module_upgrade: Add script for renaming modules in all system config files. This is invoked from the kernel post-install script (#47755). -* Mon May 02 2005 schwab@suse.de +* Tue May 03 2005 schwab@suse.de - Initialize fs_modules and drv_modules in each round. * Thu Mar 31 2005 hare@suse.de - Fix booting from DASD on S/390. @@ -876,7 +885,7 @@ be achieved by running mkinitrd with chroot inside the real root directory. - Add missing -p flags to mkdirs. -* Sun Aug 22 2004 olh@suse.de +* Mon Aug 23 2004 olh@suse.de - mkinitramfs: move mount $udev_root to avoid duplicate entries in /proc/self/mounts * Sun Aug 22 2004 olh@suse.de @@ -948,7 +957,7 @@ - Convert some back-tick quoting to $() quoting. * Mon Jun 14 2004 olh@suse.de - mkinitramfs: mount /proc correctly -* Thu Jun 10 2004 agruen@suse.de +* Fri Jun 11 2004 agruen@suse.de - #41896: Fix do_chroot. * Wed Jun 09 2004 agruen@suse.de - #41821: mkinitrd / mkiniramfs vga mode scanning bug. @@ -1068,7 +1077,7 @@ raid; add fallback to scan sysfs if udev fails. * Fri Apr 02 2004 hare@suse.de - mkinitrd: Add support for large device numbers. -* Thu Apr 01 2004 agruen@suse.de +* Fri Apr 02 2004 agruen@suse.de - Report failure if binaries are not found. - Add devnumber klibc binary. - Actually include raidautorun in the initrd. @@ -1077,7 +1086,7 @@ not a RAID, and there are RAIDs configured in the rest of the system: Otherwise lvm may wrongly think that the RAID is multipath attached storage, and corrupt data. -* Tue Mar 30 2004 agruen@suse.de +* Wed Mar 31 2004 agruen@suse.de - mkinitrd: + Dereference symbolic link in hex_dev_number (fehr@suse.de). + Get rid of static device numbers, clean up device number @@ -1210,7 +1219,7 @@ - pass module parameters from /etc/modules.conf to linuxrc * Wed Oct 01 2003 schwab@suse.de - new-kernel-pkg: handle elilo. -* Mon Sep 29 2003 kukuk@suse.de +* Tue Sep 30 2003 kukuk@suse.de - Add %%defattr * Mon Sep 29 2003 agruen@suse.de - There is no mkdir in the initrd: Create all needed directories ++++++ mkinitrd.tgz ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/mkinitrd.changes new/mkinitrd-2.2/mkinitrd.changes --- old/mkinitrd-2.1/mkinitrd.changes 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/mkinitrd.changes 2008-04-01 15:07:18.000000000 +0200 @@ -1,4 +1,16 @@ ------------------------------------------------------------------- +Tue Apr 1 15:03:02 CEST 2008 - hare@suse.de + +- Cleanup save_var statements +- Match network interface by MAC address +- Update multipath handling +- add CIFS support +- Move device discovery scripts +- Use wait_for_events function instead of udevsettle +- Update udev scripts to latest upstream version +- Bump version number to 2.2 + +------------------------------------------------------------------- Wed Mar 5 15:30:38 CET 2008 - hare@suse.de - Work on non-modular systems, too (#367269) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/mkinitrd.spec new/mkinitrd-2.2/mkinitrd.spec --- old/mkinitrd-2.1/mkinitrd.spec 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/mkinitrd.spec 2008-04-01 15:07:18.000000000 +0200 @@ -17,7 +17,7 @@ #!BuildIgnore: module-init-tools e2fsprogs udev pciutils reiserfs Requires: coreutils modutils util-linux grep gzip sed gawk cpio udev pciutils sysvinit file perl AutoReqProv: on -Version: 2.1 +Version: 2.2 Release: 12 Summary: Creates an Initial RAM Disk Image for Preloading Modules BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-boot.sh new/mkinitrd-2.2/scripts/boot-boot.sh --- old/mkinitrd-2.1/scripts/boot-boot.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-boot.sh 2008-04-01 15:07:18.000000000 +0200 @@ -22,10 +22,7 @@ umount /sys # Remove exported functions -unset udev_discover_resume -unset udev_discover_dump -unset udev_discover_root -unset udev_check_for_device +unset check_for_device # Export root fs information ROOTFS_BLKDEV="$rootdev" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-cifs.sh new/mkinitrd-2.2/scripts/boot-cifs.sh --- old/mkinitrd-2.1/scripts/boot-cifs.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-cifs.sh 2008-04-01 15:07:18.000000000 +0200 @@ -0,0 +1,50 @@ +#!/bin/bash +#%stage: block +#%modules: cifs +#%programs: /sbin/mount.cifs +#%if: "$rootfstype" = "cifs" +# +##### CIFS support +## +## This is where CIFS gets mounted. +## +## Command line parameters +## ----------------------- +## +## root=cifs://[user:pass@]<server>/<folder> the cifs root path +## cifsuser=<username> (only used if not defined in root=) +## cifspass=<password> (only used if not defined in root=) +## + +if [ "$rootfstype" = "cifs" ]; then + # load the cifs module before using it + load_modules + + if [ "${rootdev%%://*}" = "cifs" ]; then # URL parsing + rootdev=${rootdev##cifs://} + username=${rootdev%@*} + password=${username#*:} + if [ "$password" ]; then + cifspass=$password + username=${username%:*} + fi + cifsuser=$username + if [ "$username" ]; then + rootdev="${rootdev#*@}" + fi + rootdev="//$rootdev" + fi + + rootfsmod= + if [ ! "$cifsuser" -o ! "$cifspass" ]; then + echo "For CIFS support you need to specify a username and password either in the cifsuser and cifspass commandline parameters or in the root= CIFS URL." + fi + if [ "$rootflags" ] ; then + rootflags="${rootflags},user=$cifsuser" + else + rootflags="user=$cifsuser" + fi + rootflags="$rootflags,pass=$cifspass" +else + dont_load_modules +fi diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-devfunctions.sh new/mkinitrd-2.2/scripts/boot-devfunctions.sh --- old/mkinitrd-2.1/scripts/boot-devfunctions.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-devfunctions.sh 2008-04-01 15:07:18.000000000 +0200 @@ -41,3 +41,52 @@ set -- $(ls -lL $1) mkdevn ${5%,} $6 } + +# Waiting for a device to appear +# device node will be created by udev +check_for_device() { + local root + local retval=1 + local timeout=$udev_timeout + local udev_devn + local udev_major + + root=$1 + if [ -n "$root" ]; then + echo -n "Waiting for device $root to appear: " + while [ $timeout -gt 0 ]; do + if [ -e $root ]; then + udev_devn=$(devnumber $root) + udev_major=$(devmajor $udev_devn) + if [ -n "$root_major" ] ; then + if [ "$udev_major" == "$root_major" ] ; then + echo " ok" + retval=0 + break; + else + echo -n "!" + multipath -v0 + wait_for_events + continue; + fi + else + echo " ok" + retval=0 + break; + fi + fi + sleep 1 + echo -n "." + timeout=$(( $timeout - 1 )) + # Recheck for LVM volumes + if [ -n "$vg_root" -a -n "$vg_roots" ] ; then + vgscan + fi + for vgr in $vg_root $vg_roots; do + vgchange -a y $vgr + done + done + fi + return $retval; +} + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-devinit_done.sh new/mkinitrd-2.2/scripts/boot-devinit_done.sh --- old/mkinitrd-2.1/scripts/boot-devinit_done.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-devinit_done.sh 2008-04-01 15:07:18.000000000 +0200 @@ -2,4 +2,4 @@ #%stage: block #%dontshow -/sbin/udevsettle --timeout=$udev_timeout +wait_for_events diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-dmraid.sh new/mkinitrd-2.2/scripts/boot-dmraid.sh --- old/mkinitrd-2.1/scripts/boot-dmraid.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-dmraid.sh 2008-04-01 15:07:18.000000000 +0200 @@ -17,5 +17,5 @@ ## /sbin/dmraid -a y -p -/sbin/udevsettle --timeout=$udev_timeout +wait_for_events diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-iscsi.sh new/mkinitrd-2.2/scripts/boot-iscsi.sh --- old/mkinitrd-2.1/scripts/boot-iscsi.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-iscsi.sh 2008-04-01 15:07:18.000000000 +0200 @@ -59,7 +59,7 @@ fi TargetNameiBFT=$iSCSI_TARGET_NAME - TargetAddressiBFT=iSCSI_TARGET_IPADDR + TargetAddressiBFT=$iSCSI_TARGET_IPADDR TargetPortiBFT=$iSCSI_TARGET_PORT fi diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-kdump.sh new/mkinitrd-2.2/scripts/boot-kdump.sh --- old/mkinitrd-2.1/scripts/boot-kdump.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-kdump.sh 2008-04-01 15:07:18.000000000 +0200 @@ -17,6 +17,32 @@ ## dumpdev the device to dump to ## +kdump_discover_dumpdev() { + local root + case "$dumpdev" in + *:*) root= ;; + /dev/nfs) root= ;; + /dev/*) root=${rootdev#/dev/} ;; + esac + if [ -z "$root" ]; then + return 0 + fi + if check_for_device $dumpdev ; then + # Get major:minor number of the device node + devn=$(devnumber $rootdev) + major=$(devmajor $devn) + minor=$(devminor $devn) + fi + if [ -n "$devn" ]; then + echo "rootfs: major=$major minor=$minor" \ + "devn=$devn" + echo $devn > /proc/sys/kernel/real-root-dev + return 0 + else + return 1 + fi +} + # Check whether kdump is enabled if [ -s /proc/vmcore -a -b "$dumpdev" ] ; then # Do not attempt resuming when running under kdump @@ -24,7 +50,7 @@ unset resumedev # And now for the real thing - if udev_discover_dump ; then + if kdump_discover_dumpdev ; then echo "ok, dumping to $dumpdev" cp --sparse=always /proc/vmcore $dumpdev if [ $? -eq 0 ] ; then @@ -34,3 +60,5 @@ echo "Dumping failed, continue with booting" fi fi + +unset kdump_discover_dumpdev diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-lvm2.sh new/mkinitrd-2.2/scripts/boot-lvm2.sh --- old/mkinitrd-2.1/scripts/boot-lvm2.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-lvm2.sh 2008-04-01 15:07:18.000000000 +0200 @@ -21,36 +21,39 @@ load_modules if [ -n "$root_lvm2" ] ; then - o=$(get_param root) - case $o in - /dev/disk/by-*/*) - vg_root= - ;; - /dev/mapper/*) - vg_name=${o##root=/dev/mapper/} - vg_root=${vg_name%%-*} - ;; - /dev/*) - set -- $(IFS=/ ; echo $o) - if [ "$#" = "3" ] ; then - # Check sysfs. If there are subdirectories - # matching this name it's a block device - for d in /sys/block/$2\!* ; do - if [ -d $d ] ; then - sysdev=$d - fi - done - # Not found in sysfs, looks like a VG then - if [ -z "$sysdev" ] ; then - vg_root=$2 - fi - fi - ;; - esac - + o=$(get_param root) + case $o in + /dev/disk/by-*/*) + vg_root= + ;; + /dev/mapper/*) + vg_name=${o##root=/dev/mapper/} + vg_root=${vg_name%%-*} + ;; + /dev/*) + set -- $(IFS=/ ; echo $o) + if [ "$#" = "3" ] ; then + # Check sysfs. If there are subdirectories + # matching this name it's a block device + for d in /sys/block/$2\!* ; do + if [ -d $d ] ; then + sysdev=$d + fi + done + # Not found in sysfs, looks like a VG then + if [ -z "$sysdev" ] ; then + vg_root=$2 + fi + fi + ;; + esac + if [ "$vg_root" ] || [ "$vg_roots" ] ; then + # We are waiting for a device-mapper device + root_major=$(sed -n 's/\(.*\) device-mapper/\1/p' /proc/devices) + fi fi # initialize remebered and parameterized devices -for vgr in $lvm $vg_root $vg_roots; do +for vgr in $vg_root $vg_roots; do vgchange -a y $vgr done diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-mount.sh new/mkinitrd-2.2/scripts/boot-mount.sh --- old/mkinitrd-2.1/scripts/boot-mount.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-mount.sh 2008-04-01 15:07:18.000000000 +0200 @@ -20,13 +20,48 @@ ## ro mount the root device read-only ## -( set +u; test -n "$ro") && read_only=1 +discover_root() { + local root devn + case "$rootdev" in + *:/*) root= ;; + /dev/nfs) root= ;; + /dev/*) root=${rootdev#/dev/} ;; + esac + if [ -z "$root" ]; then + return 0 + fi + if check_for_device $rootdev ; then + # Get major:minor number of the device node + devn=$(devnumber $rootdev) + fi + if [ ! "$devn" ]; then + if [ ! "$1" ]; then + # try the stored fallback device + echo \ +"Could not find $rootdev. +Want me to fall back to $fallback_rootdev? (Y/n) " + read y + if [ "$y" = n ]; then + return 1 + fi + rootdev="$fallback_rootdev" + if ! discover_root x ; then + return 1 + fi + else + return 1 + fi + fi + return 0 +} + +read_only=${cmd_ro} [ -x /lib/udev/vol_id ] && VOL_ID=/lib/udev/vol_id [ -x /sbin/vol_id ] && VOL_ID=/sbin/vol_id # And now for the real thing -if ! udev_discover_root ; then +if ! discover_root ; then echo "not found -- exiting to /bin/sh" cd / PATH=$PATH PS1='$ ' /bin/sh -i @@ -90,3 +125,5 @@ cd / PATH=$PATH PS1='$ ' /bin/sh -i fi + +unset discover_root diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-multipath.sh new/mkinitrd-2.2/scripts/boot-multipath.sh --- old/mkinitrd-2.1/scripts/boot-multipath.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-multipath.sh 2008-04-01 15:07:18.000000000 +0200 @@ -28,13 +28,12 @@ mpath_status=off fi if [ "$mpath_status" != "off" ] ; then + # We are waiting for a device-mapper device + root_major=$(sed -n 's/\(.*\) device-mapper/\1/p' /proc/devices) # Rescan for multipath echo -n "Setup multipath devices: " /sbin/multipath -v0 - /sbin/udevsettle --timeout=$udev_timeout - # On larger setups udev might time out prematurely - /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p -part" - /sbin/udevsettle --timeout=$udev_timeout + wait_for_events echo 'ok.' fi diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-resume.kernel.sh new/mkinitrd-2.2/scripts/boot-resume.kernel.sh --- old/mkinitrd-2.1/scripts/boot-resume.kernel.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-resume.kernel.sh 2008-04-01 15:07:18.000000000 +0200 @@ -4,8 +4,6 @@ #%provides: resume #%depends: resume.userspace # -#%if: -z "$is_kdump" -a -z "$kdump_kernel" -# ##### software suspend resume ## ## If software suspending has suspended the computer before @@ -19,7 +17,7 @@ ## resume the device to resume from ## -[ "$( ( set -u; echo $noresume >/dev/null; echo 1 ) 2>/dev/null )" = "1" ] && resume_mode=off +[ "$noresume" ] && resume_mode=off # Verify manual resume mode if [ "$resume_mode" != "off" -a -n "$resumedev" ]; then @@ -55,8 +53,7 @@ fi fi } -# Wait for udev to settle -/sbin/udevsettle --timeout=$udev_timeout +wait_for_events # Check for a resume device discover_kernel_resume diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-resume.userspace.sh new/mkinitrd-2.2/scripts/boot-resume.userspace.sh --- old/mkinitrd-2.1/scripts/boot-resume.userspace.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-resume.userspace.sh 2008-04-01 15:07:18.000000000 +0200 @@ -4,7 +4,7 @@ #%provides: resume #%depends: dump # -#%if: -z "$is_kdump" -a -z "$kdump_kernel" -a '(' -x /usr/sbin/resume -o -x /sbin/resume ')' +#%if: -x /usr/sbin/resume -o -x /sbin/resume #%programs: /sbin/resume # ##### software suspend resume @@ -20,7 +20,7 @@ ## resume the device to resume from ## -[ "$( ( set -u; echo $noresume >/dev/null; echo 1 ) 2>/dev/null )" = "1" ] && resume_mode=off +[ "$noresume" ] && resume_mode=off # Verify manual resume mode if [ "$resume_mode" != "off" -a -n "$resumedev" ]; then @@ -59,8 +59,7 @@ fi } -# Wait for udev to settle -/sbin/udevsettle --timeout=$udev_timeout +wait_for_events # Check for a resume device discover_user_resume diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-start.sh new/mkinitrd-2.2/scripts/boot-start.sh --- old/mkinitrd-2.1/scripts/boot-start.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-start.sh 2008-04-01 15:07:18.000000000 +0200 @@ -62,12 +62,13 @@ key="${o%%=*}" if [ "${key%.*}" != "${key}" ]; then # module parameter add_module_param "${key%.*}" "${o#*.}" - elif [ "${key}" != "${o}" ] ; then + else # environment variable # set local variables too, in case somehow the kernel does not do this correctly value="${o#*=}" - eval cmd_$key="$value" - eval $key="$value" + value=${value:=1} + eval cmd_$key="${value}" + eval $key="${value}" 2> /dev/null fi done @@ -128,8 +129,6 @@ fi ;; esac -# Default timeout is 30 seconds -udev_timeout=30 if [ "$linuxrc" = "trace" ]; then echo -n "cmdline: " diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-storage.sh new/mkinitrd-2.2/scripts/boot-storage.sh --- old/mkinitrd-2.1/scripts/boot-storage.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-storage.sh 2008-04-01 15:07:18.000000000 +0200 @@ -70,6 +70,9 @@ min=$(($rootdev & 0xff)) echo "SUBSYSTEM==\"block\", SYSFS{dev}==\"$maj:$min\", SYMLINK+=\"root\"" > /etc/udev/rules.d/05-mkinitrd-lilo.rules rootdev=/dev/root ;; + *://*) # URL type + rootfstype=${rootdev%%://*} + ;; *:/*) rootfstype="nfs" ;; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/boot-udev.sh new/mkinitrd-2.2/scripts/boot-udev.sh --- old/mkinitrd-2.1/scripts/boot-udev.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/boot-udev.sh 2008-04-01 15:07:18.000000000 +0200 @@ -1,7 +1,7 @@ #!/bin/bash #%stage: boot #%depends: start dm -#%programs: /sbin/udevd /sbin/udevadm /sbin/udevtrigger /sbin/udevsettle udevinfo /sbin/udevcontrol +#%programs: /sbin/udevd /sbin/udevadm #%dontshow # ##### udev initialization @@ -13,124 +13,8 @@ ## ----------------------- ## -# Waiting for a device to appear -# device node will be created by udev -udev_check_for_device() { - local root - local retval=1 - local timeout=$udev_timeout - root=$1 - if [ -n "$root" ]; then - echo -n "Waiting for device $root to appear: " - while [ $timeout -gt 0 ]; do - if [ -e $root ]; then - echo " ok" - retval=0 - break; - fi - sleep 1 - echo -n "." - timeout=$(( $timeout - 1 )) - # Recheck for LVM volumes - if [ -n "$lvm" -a -n "$vg_root" -a -n "$vg_roots" ] ; then - vgscan - fi - for vgr in $lvm $vg_root $vg_roots; do - vgchange -a y $vgr - done - done - fi - return $retval; -} - -udev_discover_resume() { - local resume devn major minor - if [ ! -f /sys/power/resume ] ; then - return - fi - if [ -z "$resumedev" ] ; then - return - fi - # Waits for the resume device to appear - if [ "$resume_mode" != "off" ]; then - if [ -e $resumedev ] ; then - # Try major:minor number of the device node - devn=$(devnumber $resumedev) - major=$(devmajor $devn) - minor=$(devminor $devn) - fi - if [ -n "$major" -a -n "$minor" ]; then - if [ -x /sbin/resume ]; then - echo "Invoking userspace resume from $resumedev" - /sbin/resume $resumedev - fi - echo "Invoking in-kernel resume from $resumedev" - echo "$major:$minor" > /sys/power/resume - else - echo "resume device $resumedev not found (ignoring)" - fi - fi -} - -udev_discover_dump() { - local root - case "$dumpdev" in - *:*) root= ;; - /dev/nfs) root= ;; - /dev/*) root=${rootdev#/dev/} ;; - esac - if [ -z "$root" ]; then - return 0 - fi - if udev_check_for_device $dumpdev ; then - # Get major:minor number of the device node - devn=$(devnumber $rootdev) - major=$(devmajor $devn) - minor=$(devminor $devn) - fi - if [ -n "$devn" ]; then - echo "rootfs: major=$major minor=$minor" \ - "devn=$devn" - echo $devn > /proc/sys/kernel/real-root-dev - return 0 - else - return 1 - fi -} - -udev_discover_root() { - local root devn - case "$rootdev" in - *:/*) root= ;; - /dev/nfs) root= ;; - /dev/*) root=${rootdev#/dev/} ;; - esac - if [ -z "$root" ]; then - return 0 - fi - if udev_check_for_device $rootdev ; then - # Get major:minor number of the device node - devn=$(devnumber $rootdev) - fi - if [ ! "$devn" ]; then - if [ ! "$1" ]; then - # try the stored fallback device - echo \ -"Could not find $rootdev. -Want me to fall back to $fallback_rootdev? (Y/n) " - read y - if [ "$y" = n ]; then - return 1 - fi - rootdev="$fallback_rootdev" - if ! udev_discover_root x ; then - return 1 - fi - else - return 1 - fi - fi - return 0 +wait_for_events() { + /sbin/udevadm settle --timeout=$udev_timeout } # Check for debugging @@ -143,5 +27,5 @@ # Start udev echo "Creating device nodes with udev" /sbin/udevd --daemon -/sbin/udevtrigger -/sbin/udevsettle --timeout=$udev_timeout +/sbin/udevadm trigger +wait_for_events diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-cifs.sh new/mkinitrd-2.2/scripts/setup-cifs.sh --- old/mkinitrd-2.1/scripts/setup-cifs.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-cifs.sh 2008-04-01 15:07:18.000000000 +0200 @@ -0,0 +1,9 @@ +#!/bin/bash +# +#%stage: device +# + +if [ "$rootfstype" = "cifs" ]; then + interface=default + save_var rootfstype +fi diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-iscsi.sh new/mkinitrd-2.2/scripts/setup-iscsi.sh --- old/mkinitrd-2.1/scripts/setup-iscsi.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-iscsi.sh 2008-04-01 15:07:18.000000000 +0200 @@ -6,7 +6,7 @@ local devname=$1 local sysfs_path - sysfs_path=$(udevinfo -q path -n $rootdev 2> /dev/null) + sysfs_path=$(/sbin/udevadm info -q path -n $rootdev 2> /dev/null) if [ -z "$sysfs_path" ] || [ ! -d /sys$sysfs_path ] ; then return; fi diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-mount.sh new/mkinitrd-2.2/scripts/setup-mount.sh --- old/mkinitrd-2.1/scripts/setup-mount.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-mount.sh 2008-04-01 15:07:18.000000000 +0200 @@ -7,7 +7,7 @@ rootfsck="/sbin/fsck.${rootfstype}" if [ ! -x "$rootfsck" ]; then rootfsck= - if [ "$rootfstype" != "nfs" ] || [ "$rootfstype" != "xfs" ]; then + if [ "$rootfstype" != "nfs" -a "$rootfstype" != "xfs" -a "$rootfstype" != "cifs" ]; then echo "****************************" echo "* WARNING " echo "* No fsck for your rootfs " diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-network.sh new/mkinitrd-2.2/scripts/setup-network.sh --- old/mkinitrd-2.1/scripts/setup-network.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-network.sh 2008-04-01 15:07:18.000000000 +0200 @@ -75,6 +75,15 @@ # Get info from install.inf during installation BOOTPROTO=$(sed -ne 's/NetConfig: \(.*\)/\1/p' $inffile) ifname=$(sed -ne 's/Netdevice: \(.*\)/\1/p' $inffile) + macaddress=$(sed -ne 's/HWAddr: \(.*\)/\1/p' /etc/install.inf) + if [ "$macaddress" ] ; then + for dev in /sys/class/net/* ; do + read tmpmac < $dev/address + if [ "$tmpmac" == "$macaddress" ] ; then + ifname=${dev##*/} + fi + done + fi fi # interface description not found in install.inf if [ ! "$ifname" ]; then diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-nfs.sh new/mkinitrd-2.2/scripts/setup-nfs.sh --- old/mkinitrd-2.1/scripts/setup-nfs.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-nfs.sh 2008-04-01 15:07:18.000000000 +0200 @@ -2,31 +2,6 @@ # #%stage: device # -case "$rootdev" in - /dev/nfs) - rootfstype=nfs - rootdev= - use_dhcp=1 - ;; - /dev/*) - ;; - *://*) - rootfstype=${rootdev%%://*} - interface=default - save_var rootfstype - ;; - *:/*) - rootfstype=nfs - ;; -esac - -if [ -z "$rootdev" ] ; then - if [ -z "$use_dhcp" ]; then - error 1 "No '/' mountpoint specified and no automatic configuration via dhcp" - else - rootfstype=nfs - fi -fi if [ "$rootfstype" = "nfs" ]; then interface=default diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-prepare.sh new/mkinitrd-2.2/scripts/setup-prepare.sh --- old/mkinitrd-2.1/scripts/setup-prepare.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-prepare.sh 2008-04-01 15:07:18.000000000 +0200 @@ -75,94 +75,89 @@ } - local kernel_version - local need_raidstart - local need_mdadm - local need_dmraid - local is_kdump - local -a features - local fs_modules drv_modules uld_modules xen_modules - local i - - tmp_mnt=$work_dir/mnt - tmp_mnt_small=${tmp_mnt}_small - tmp_msg=$work_dir/msg$$ - vendor_script=$tmp_mnt/vendor_init.sh - - linuxrc=$tmp_mnt/init - - if [ ! -f "$kernel_image" ] ; then - error 1 "No kernel image $kernel_image found" - fi - - kernel_version=$(/sbin/get_kernel_version $kernel_image) - modules_dir=$root_dir/lib/modules/$kernel_version - - #echo -e "Kernel version:\t$kernel_version" - echo -e "Kernel image: $kernel_image" - echo -e "Initrd image: $initrd_image" - - if [ ! -d "$modules_dir/misc" -a \ - ! -d "$modules_dir/kernel" ]; then - echo -e "Kernel Modules: <not available>" - fi - - # And run depmod to ensure proper loading - if [ "$sysmap" ] ; then - map="$sysmap" - else - map=$root_dir/boot/System.map-$kernel_version - fi - if [ ! -f $map ]; then - map=$root_dir/boot/System.map - fi - if [ ! -f $map ]; then - oops 9 "Could not find map $map, please specify a correct file with -M." - fi - - # create an empty initrd - if ! mkdir $tmp_mnt ; then - error 1 "could not create temporary directory" - fi - - # fill the initrd - cp $INITRD_PATH/bin/linuxrc $linuxrc - mkdir "$tmp_mnt/boot" - - mkdir -p $tmp_mnt/{sbin,bin,etc,dev,proc,sys,root,config} - - mkdir -p -m 4777 $tmp_mnt/tmp - - # Create a dummy /etc/mtab for mount/umount - echo -n > $tmp_mnt/etc/mtab - - # Add modprobe, modprobe.conf*, and a version of /bin/true: modprobe.conf - # might use it. - cp -r $root_dir/etc/modprobe.conf $root_dir/etc/modprobe.conf.local \ - $root_dir/etc/modprobe.d $tmp_mnt/etc - cat > $tmp_mnt/bin/true <<-EOF - #! /bin/sh - : - EOF - chmod +x $tmp_mnt/bin/true +local kernel_version +local -a features +local fs_modules drv_modules uld_modules xen_modules + +tmp_mnt=$work_dir/mnt +tmp_mnt_small=${tmp_mnt}_small +tmp_msg=$work_dir/msg$$ +vendor_script=$tmp_mnt/vendor_init.sh + +linuxrc=$tmp_mnt/init + +if [ ! -f "$kernel_image" ] ; then + error 1 "No kernel image $kernel_image found" +fi + +kernel_version=$(/sbin/get_kernel_version $kernel_image) +modules_dir=$root_dir/lib/modules/$kernel_version + +#echo -e "Kernel version:\t$kernel_version" +echo -e "Kernel image: $kernel_image" +echo -e "Initrd image: $initrd_image" + +if [ ! -d "$modules_dir/misc" -a \ + ! -d "$modules_dir/kernel" ]; then + echo -e "Kernel Modules: <not available>" +fi + +# And run depmod to ensure proper loading +if [ "$sysmap" ] ; then + map="$sysmap" +else + map=$root_dir/boot/System.map-$kernel_version +fi +if [ ! -f $map ]; then + map=$root_dir/boot/System.map +fi +if [ ! -f $map ]; then + oops 9 "Could not find map $map, please specify a correct file with -M." +fi + +# create an empty initrd +if ! mkdir $tmp_mnt ; then + error 1 "could not create temporary directory" +fi + +# fill the initrd +cp $INITRD_PATH/bin/linuxrc $linuxrc +mkdir "$tmp_mnt/boot" + +mkdir -p $tmp_mnt/{sbin,bin,etc,dev,proc,sys,root,config} + +mkdir -p -m 4777 $tmp_mnt/tmp + +# Create a dummy /etc/mtab for mount/umount +echo -n > $tmp_mnt/etc/mtab + +# Add modprobe, modprobe.conf*, and a version of /bin/true: modprobe.conf +# might use it. +cp -r $root_dir/etc/modprobe.conf $root_dir/etc/modprobe.conf.local \ + $root_dir/etc/modprobe.d $tmp_mnt/etc +cat > $tmp_mnt/bin/true <<-EOF +#! /bin/sh +: +EOF +chmod +x $tmp_mnt/bin/true - mkdir -p $tmp_mnt/var/log +mkdir -p $tmp_mnt/var/log - # all dev nodes belong to root, but some may be - # owned by a group other than root - # getent passwd | sed '/^root:/s/^\([^:]\+\):[^:]*:\([^:]\+\):\([^:]\+\):.*/\1::\2:\3:::/p;d' > $tmp_mnt/etc/passwd - echo 'root::0:0:::' > $tmp_mnt/etc/passwd - echo 'nobody::65534:65533:::' >> $tmp_mnt/etc/passwd - getent group | sed 's/^\([^:]\+\):[^:]*:\([^:]\+\):.*/\1::\2:/' > $tmp_mnt/etc/group - (echo 'passwd: files';echo 'group: files') > $tmp_mnt/etc/nsswitch.conf - - # scsi_id config file - cp /etc/scsi_id.config $tmp_mnt/etc/scsi_id.config - - # HBA firmware - mkdir -p $tmp_mnt/lib/firmware - for fw in /lib/firmware/ql*.bin /lib/firmware/aic94xx* ; do - if [ -f "$fw" ] ; then - cp -a $fw $tmp_mnt/lib/firmware - fi - done +# all dev nodes belong to root, but some may be +# owned by a group other than root +# getent passwd | sed '/^root:/s/^\([^:]\+\):[^:]*:\([^:]\+\):\([^:]\+\):.*/\1::\2:\3:::/p;d' > $tmp_mnt/etc/passwd +echo 'root::0:0:::' > $tmp_mnt/etc/passwd +echo 'nobody::65534:65533:::' >> $tmp_mnt/etc/passwd +getent group | sed 's/^\([^:]\+\):[^:]*:\([^:]\+\):.*/\1::\2:/' > $tmp_mnt/etc/group +(echo 'passwd: files';echo 'group: files') > $tmp_mnt/etc/nsswitch.conf + +# scsi_id config file +cp /etc/scsi_id.config $tmp_mnt/etc/scsi_id.config + +# HBA firmware +mkdir -p $tmp_mnt/lib/firmware +for fw in /lib/firmware/ql*.bin /lib/firmware/aic94xx* ; do + if [ -f "$fw" ] ; then + cp -a $fw $tmp_mnt/lib/firmware + fi +done diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-start.sh new/mkinitrd-2.2/scripts/setup-start.sh --- old/mkinitrd-2.1/scripts/setup-start.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-start.sh 2008-04-01 15:07:18.000000000 +0200 @@ -19,88 +19,8 @@ return } -save_var arg -save_var blogd_pid +# Set in the mkinitrd script save_var build_day -save_var cont -save_var current_day -save_var debug_linuxrc -save_var dev -save_var devflags -save_var devn -save_var devpts -save_var DHCPSIADDR -save_var DHCPSNAME -save_var dmdevs -save_var DNS -save_var DOMAIN -save_var driver -save_var dumpdev -save_var evms_cmd -save_var evms_cont -save_var evmsnum -save_var evms_reg -save_var evms_seg -save_var fbnum -save_var fsckopts -save_var fsoptions -save_var init -save_var interface.info -save_var interface -save_var iSCSI_INITIATOR_NAME -save_var iscsi_pid -save_var iscsiport -save_var iscsiserver -save_var iSCSI_TARGET_IPADDR -save_var iscsitarget -save_var iSCSI_TARGET_NAME -save_var iSCSI_TARGET_PORT -save_var iscsi_tgts -save_var is_kdump -save_var journaldev -save_var kdump_kernel -save_var kernel_cmdline -save_var label -save_var link -save_var macaddress -save_var maj -save_var major -save_var md_dev -save_var md_minor -save_var md_uuid -save_var min -save_var minorhi -save_var minor -save_var mpath_list -save_var mpath_status -save_var need_dmraid -save_var need_mdadm -save_var need_raidstart -save_var node -save_var ns -save_var num -save_var oifs -save_var opt -save_var read_only -save_var read_write -save_var REDIRECT -save_var reg -save_var resumedev -save_var resume_minor -save_var resume_mode -save_var retval -save_var rootdevid -save_var realrootdev -save_var ROOTFS_FSCK -save_var rootfstype -save_var ROOTPATH -save_var root -save_var seg -save_var tblfile -save_var tgt -save_var timeout -save_var tty_driver -save_var uuid if [ -z "$modules_set" ]; then # get INITRD_MODULES from system configuration diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-storage.sh new/mkinitrd-2.2/scripts/setup-storage.sh --- old/mkinitrd-2.1/scripts/setup-storage.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-storage.sh 2008-04-01 15:07:18.000000000 +0200 @@ -68,7 +68,7 @@ local olddev="$1" udevdevs dev # search for udev information - udevdevs=$(udevinfo -q symlink --name=$olddev) + udevdevs=$(/sbin/udevadm info -q symlink --name=$olddev) # look up ata device links for dev in $udevdevs; do if [ "$(echo $dev | grep /ata-)" ] ; then @@ -152,7 +152,9 @@ # this receives information about the current blockdev so each storage layer has access to it for its current blockdev update_blockdev() { local curblockdev=$1 - [ -z "$curblockdev" ] && curblockdev=$blockdev + [ "$curblockdev" ] || curblockdev=$blockdev + # no blockdevs + [ "$curblockdev" ] || return blockmajor=-1 blockminor=-1 @@ -214,11 +216,8 @@ /dev/disk/*) realrootdev=$(/usr/bin/readlink -m $realrootdev) ;; - *:*) - if [ "$type" = "Root" ]; then - rootfstype=nfs - x="nfs-root" - fi + *:*|//*) + [ "$type" = "Root" ] && x="$rootfstype-root" ;; esac @@ -303,13 +302,22 @@ # check for nfs root and set the rootfstype accordingly case "$rootdev" in - /dev/*) + /dev/nfs) + rootfstype=nfs + use_dhcp=1 + ;; + /dev/*) if [ ! -e "$rootdev" ]; then error 1 "Root device ($rootdev) not found" fi ;; - *:*) + *://*) # URL type + rootfstype=${rootdev%%://*} + interface=default + ;; + *:*) rootfstype=nfs + interface=default ;; esac @@ -320,7 +328,12 @@ fi if [ ! "$rootfstype" ]; then - error 1 "Could not find the filesystem type for root device $rootdev" + error 1 "Could not find the filesystem type for root device $rootdev + +Currently available -d parameters are: + Block devices /dev/<device> + NFS <server>:<path> + URL <protocol>://<path>" fi # Check if we have to load a module for the rootfs type @@ -341,5 +354,9 @@ fallback_rootdev="$rootdev" save_var fallback_rootdev +save_var rootdev +save_var resumedev +save_var journaldev +save_var dumpdev blockdev="$(resolve_device Root $rootdev) $(resolve_device Resume $resumedev) $(resolve_device Journal $journaldev) $(resolve_device Dump $dumpdev)" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/mkinitrd-2.1/scripts/setup-udev.sh new/mkinitrd-2.2/scripts/setup-udev.sh --- old/mkinitrd-2.1/scripts/setup-udev.sh 2008-03-05 15:32:16.000000000 +0100 +++ new/mkinitrd-2.2/scripts/setup-udev.sh 2008-04-01 15:07:18.000000000 +0200 @@ -3,6 +3,10 @@ #%stage: setup #%depends: start # + +# Default udev timeout is 30 seconds +udev_timeout=30 + mkdir -p $tmp_mnt/etc/udev/rules.d # copy needed rules for rule in \ @@ -29,3 +33,4 @@ fi done +save_var udev_timeout ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org