Hello community, here is the log from the commit of package mkinitrd for openSUSE:Factory checked in at Mon Aug 22 15:43:53 CEST 2011. -------- --- mkinitrd/mkinitrd.changes 2011-08-01 17:18:46.000000000 +0200 +++ /mounts/work_src_done/STABLE/mkinitrd/mkinitrd.changes 2011-08-20 14:27:46.000000000 +0200 @@ -1,0 +2,29 @@ +Sat Aug 20 12:26:20 UTC 2011 - mmarek@suse.cz + +- Fix mkinitrd -D default (bnc#713103). + +------------------------------------------------------------------- +Tue Aug 9 14:51:37 UTC 2011 - hare@suse.de + +- Add the 'root' argument in the call to check_for_device() + (bnc#699870). + +------------------------------------------------------------------- +Thu Aug 4 10:36:54 CEST 2011 - fcrozat@suse.com + +- Output fsck result on root partition to /run/initramfs/root-fsck, + to prevent systemd to do it again. + +------------------------------------------------------------------- +Wed Aug 3 13:35:19 UTC 2011 - mmarek@suse.cz + +- Mount the /usr filesystem in the initrd + It has still some rough edges, like support for journal device or + booting from nfs, but simple cases should work. + +------------------------------------------------------------------- +Tue Aug 2 12:12:04 UTC 2011 - mmarek@novell.com + +- Run cpio with the --quiet option. + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mkinitrd.spec ++++++ --- /var/tmp/diff_new_pack.QATsOV/_old 2011-08-22 15:42:57.000000000 +0200 +++ /var/tmp/diff_new_pack.QATsOV/_new 2011-08-22 15:42:57.000000000 +0200 @@ -31,7 +31,7 @@ %endif AutoReqProv: on Version: 2.7.0 -Release: 25 +Release: 27 Conflicts: udev < 118 Requires: dhcpcd PreReq: %fillup_prereq ++++++ mkinitrd.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/mkinitrd.changes new/mkinitrd-2.7.0/mkinitrd.changes --- old/mkinitrd-2.7.0/mkinitrd.changes 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/mkinitrd.changes 2011-08-20 14:26:40.000000000 +0200 @@ -1,4 +1,33 @@ ------------------------------------------------------------------- +Sat Aug 20 12:26:20 UTC 2011 - mmarek@suse.cz + +- Fix mkinitrd -D default (bnc#713103). + +------------------------------------------------------------------- +Tue Aug 9 14:51:37 UTC 2011 - hare@suse.de + +- Add the 'root' argument in the call to check_for_device() + (bnc#699870). + +------------------------------------------------------------------- +Thu Aug 4 10:36:54 CEST 2011 - fcrozat@suse.com + +- Output fsck result on root partition to /run/initramfs/root-fsck, + to prevent systemd to do it again. + +------------------------------------------------------------------- +Wed Aug 3 13:35:19 UTC 2011 - mmarek@suse.cz + +- Mount the /usr filesystem in the initrd + It has still some rough edges, like support for journal device or + booting from nfs, but simple cases should work. + +------------------------------------------------------------------- +Tue Aug 2 12:12:04 UTC 2011 - mmarek@novell.com + +- Run cpio with the --quiet option. + +------------------------------------------------------------------- Mon Aug 1 15:09:15 UTC 2011 - mmarek@suse.cz - Only copy /usr/bin/on_ac_power if it exists (bnc#708326). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/sbin/lsinitrd new/mkinitrd-2.7.0/sbin/lsinitrd --- old/mkinitrd-2.7.0/sbin/lsinitrd 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/sbin/lsinitrd 2011-08-20 14:26:40.000000000 +0200 @@ -70,11 +70,11 @@ if [ "$config" -eq 1 ] ; then # yes, that's snow, but doesn't use any temporary files :) - for configfile in $(zcat $initrd | cpio $args 2>/dev/null | grep '^config/') ; do + for configfile in $(zcat $initrd | cpio $args --quiet | grep '^config/') ; do echo "=========> $configfile <============" - zcat $initrd | cpio -i --to-stdout $configfile 2>/dev/null + zcat $initrd | cpio --quiet -i --to-stdout $configfile echo done else - zcat $initrd | cpio $args + zcat $initrd | cpio --quiet $args fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/boot-boot.sh new/mkinitrd-2.7.0/scripts/boot-boot.sh --- old/mkinitrd-2.7.0/scripts/boot-boot.sh 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/boot-boot.sh 2011-08-20 14:26:40.000000000 +0200 @@ -2,7 +2,7 @@ # #%stage: setup #%depends: killprogs -#%programs: +#%programs: chroot #%modules: #%dontshow # @@ -86,6 +86,15 @@ umount -l /run fi +# Mount the /usr filesystem if possible +# XXX: handle journaldev for the /usr device separately +if test -n "$usrdev"; then + if chroot /root /sbin/fsck -t $usrfstype $fsckopts $usrdev; then + echo "Mounting /usr" + chroot /root /bin/mount /usr + fi +fi + # SELinux load policy selinux_load_policy "/root" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/boot-mount.sh new/mkinitrd-2.7.0/scripts/boot-mount.sh --- old/mkinitrd-2.7.0/scripts/boot-mount.sh 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/boot-mount.sh 2011-08-20 14:26:40.000000000 +0200 @@ -29,7 +29,7 @@ if [ -z "$root" ]; then return 0 fi - if check_for_device $rootdev ; then + if check_for_device $rootdev root ; then # Get major:minor number of the device node devn=$(devnumber $rootdev) fi @@ -106,6 +106,8 @@ # Return the fsck status ROOTFS_FSCK=$? export ROOTFS_FSCK + mkdir /run/initramfs + echo $ROOTFS_FSCK >/run/initramfs/root-fsck ROOTFS_FSTYPE=$rootfstype export ROOTFS_FSTYPE if [ $ROOTFS_FSCK -gt 1 -a $ROOTFS_FSCK -lt 4 ]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/boot-storage.sh new/mkinitrd-2.7.0/scripts/boot-storage.sh --- old/mkinitrd-2.7.0/scripts/boot-storage.sh 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/boot-storage.sh 2011-08-20 14:26:40.000000000 +0200 @@ -34,50 +34,57 @@ [ "$resume" ] && resumedev="$resume" [ "$journal" ] && journaldev="$journal" -# lilo strips off the /dev/prefix from device names! -case $rootdev in - /dev/disk/by-name/*) - rootdevid=${rootdev#/dev/disk/by-name/} - rootdevid=${rootdevid%-part*} - ;; - /dev/md*) - md_dev=$rootdev - md_minor=${rootdev#/dev/md} - ;; - /dev/*) - ;; - LABEL=*) - label=${rootdev#LABEL=} - echo "ENV{ID_FS_USAGE}==\"filesystem|other\", ENV{ID_FS_LABEL_ENC}==\"$label\", SYMLINK+=\"root\"" > /etc/udev/rules.d/99-mkinitrd-label.rules - rootdev=/dev/root - ;; - UUID=*) - uuid=${rootdev#UUID=} - echo "ENV{ID_FS_USAGE}==\"filesystem|other\", ENV{ID_FS_UUID}==\"$uuid\", SYMLINK+=\"root\"" > /etc/udev/rules.d/99-mkinitrd-uuid.rules - rootdev=/dev/root - ;; - [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) - maj=$((0x0$rootdev >> 8)) - min=$((0x0$rootdev & 0xff)) - echo "SUBSYSTEM==\"block\", SYSFS{dev}==\"$maj:$min\", SYMLINK+=\"root\"" > /etc/udev/rules.d/05-mkinitrd-lilo.rules - rootdev=/dev/root ;; - [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) - maj=$((0x$rootdev >> 8)) - min=$((0x$rootdev & 0xff)) - echo "SUBSYSTEM==\"block\", SYSFS{dev}==\"$maj:$min\", SYMLINK+=\"root\"" > /etc/udev/rules.d/05-mkinitrd-lilo.rules - rootdev=/dev/root ;; - 0x[0-9a-fA-F][0-9a-fA-F]*) - maj=$(($rootdev >> 8)) - 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" - ;; - *) - [ "$rootdev" ] && rootdev=/dev/$rootdev - ;; -esac +for name in root usr; do + # lilo strips off the /dev/prefix from device names! + var_dev=${name}dev + var_fstype=${name}fstype + dev=${!var_dev} + fstype=${!var_fstype} + case "$dev" in + /dev/md*) + # FIXME: support for / and /usr on different md devices + md_dev=$rootdev + md_minor=${rootdev#/dev/md} + ;; + /dev/*) + ;; + LABEL=*) + label=${dev#LABEL=} + echo "ENV{ID_FS_USAGE}==\"filesystem|other\", ENV{ID_FS_LABEL_ENC}==\"$label\", SYMLINK+=\"$name\"" > /etc/udev/rules.d/99-mkinitrd-$name-label.rules + dev=/dev/$name + ;; + UUID=*) + uuid=${dev#UUID=} + echo "ENV{ID_FS_USAGE}==\"filesystem|other\", ENV{ID_FS_UUID}==\"$uuid\", SYMLINK+=\"$name\"" > /etc/udev/rules.d/99-mkinitrd-$name-uuid.rules + dev=/dev/$name + ;; + [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) + maj=$((0x0$dev >> 8)) + min=$((0x0$dev & 0xff)) + echo "SUBSYSTEM==\"block\", SYSFS{dev}==\"$maj:$min\", SYMLINK+=\"$name\"" > /etc/udev/rules.d/05-mkinitrd-$name-lilo.rules + dev=/dev/$name + ;; + [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) + maj=$((0x$dev >> 8)) + min=$((0x$dev & 0xff)) + echo "SUBSYSTEM==\"block\", SYSFS{dev}==\"$maj:$min\", SYMLINK+=\"$name\"" > /etc/udev/rules.d/05-mkinitrd-$name-lilo.rules + dev=/dev/$name + ;; + 0x[0-9a-fA-F][0-9a-fA-F]*) + maj=$(($dev >> 8)) + min=$(($dev & 0xff)) + echo "SUBSYSTEM==\"block\", SYSFS{dev}==\"$maj:$min\", SYMLINK+=\"$name\"" > /etc/udev/rules.d/05-mkinitrd-lilo.rules + dev=/dev/$name ;; + *://*) # URL type + fstype=${dev%%://*} + ;; + *:/*) + fstype="nfs" + ;; + *) + [ "$dev" ] && dev=/dev/$dev + ;; + esac + read $var_dev < <(echo "$dev") + read $var_fstype < <(echo "$fstype") +done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/setup-done.sh new/mkinitrd-2.7.0/scripts/setup-done.sh --- old/mkinitrd-2.7.0/scripts/setup-done.sh 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/setup-done.sh 2011-08-20 14:26:40.000000000 +0200 @@ -7,7 +7,7 @@ pushd . > /dev/null 2>&1 cd $tmp_mnt find bin sbin -type f -print0 | xargs -0 chmod 0755 -if ! find . ! -name "*~" | cpio -H newc --create | gzip -9 > $tmp_initrd.gz +if ! find . ! -name "*~" | cpio --quiet -H newc --create | gzip -9 > $tmp_initrd.gz then oops 8 "Failed to build initrd" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/setup-network.sh new/mkinitrd-2.7.0/scripts/setup-network.sh --- old/mkinitrd-2.7.0/scripts/setup-network.sh 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/setup-network.sh 2011-08-20 14:26:40.000000000 +0200 @@ -174,7 +174,7 @@ done ip= -# get the default interface if requested +# get the default interface if requested by some script if [ "$interface" = "default" ]; then interface= if test -z "$static_interfaces$dhcp_interfaces"; then @@ -222,6 +222,12 @@ static=false continue fi + # resolve default interface if requested via the commandline -D or -I + # option + if test "$iface" = "default"; then + iface=$(get_default_interface) + iface=${iface%%/*} + fi case " $seen_interfaces " in *" $iface "*) continue diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/setup-storage.sh new/mkinitrd-2.7.0/scripts/setup-storage.sh --- old/mkinitrd-2.7.0/scripts/setup-storage.sh 2011-08-01 17:10:21.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/setup-storage.sh 2011-08-20 14:26:40.000000000 +0200 @@ -244,68 +244,145 @@ echo -en "$type device:\t$x" >&2 if [ "$type" = "Root" ]; then echo " (mounted on ${root_dir:-/} as $rootfstype)" >&2 + elif [ "$type" = "/usr" ]; then + echo " (mounted on ${root_dir:-/}usr as $usrfstype)" >&2 else echo >&2 fi echo $realrootdev } -####################################################################################### +############################################################################## -if [ -z "$rootdev" ] ; then - # no rootdev specified, get current root opts from /etc/fstab and device from stat +# usage: resolve_mountpoint name path +resolve_mountpoint() +{ + local name=$1 mountpoint=$2 + local var_dev=${name}dev var_fstype=${name}fstype var_fsopts=${name}fsopts + local var_major=${name}major var_minor=${name}minor + local dev fstype fsopts mod + local cpio major minor x1 + local fstab_device fstab_mountpoint fstab_type fstab_options dummy + + if [ -z "${!var_dev}" ] ; then + # no dev specified, get current opts from /etc/fstab and device from stat + cpio=`echo "$mountpoint" | /bin/cpio --quiet -o -H newc` + major="$(echo $(( 0x${cpio:62:8} )) )" + minor="$(echo $(( 0x${cpio:70:8} )) )" + # check if /usr is part of / + if test "$name" = "usr" -a "$major:$minor" = "$rootmajor:$rootminor"; then + return + fi + + # get opts from fstab and device too if stat failed + sed -e '/^[ \t]*#/d' < $root_dir/etc/fstab >"$work_dir/pipe" + while read fstab_device fstab_mountpoint fstab_type fstab_options dummy ; do + if [ "$fstab_mountpoint" = "$mountpoint" ]; then + update_blockdev "$fstab_device" # get major and minor + # let's see if the stat device is the same as the fstab device + if [ "$major" -eq 0 ] || [ "$blockmajor" -eq "$major" -a "$blockminor" -eq "$minor" ]; then # if both match + dev="$fstab_device" # use the fstab device so the user can decide + # how to access the device + fi + fstype="$fstab_type" + fsopts="$fstab_options" + break + fi + done < "$work_dir/pipe" + + if [ $((major)) -gt 0 -a -z "$dev" ] ; then + # don't check for non-device mounts + dev="$(majorminor2blockdev $major $minor)" + if [ -z "$dev" ]; then + error 1 "Cannot determine the $name device" + fi + update_blockdev $dev + dev="$(beautify_blockdev $dev)" + fi + fi + + #if we don't know where the device belongs to + if [ -z "$fstype" ] ; then + # get type from /etc/fstab or /proc/mounts (actually not needed) + x1=$(cat $root_dir/etc/fstab /proc/mounts 2>/dev/null \ + | grep -E "$dev[[:space:]]" | tail -n 1) + fstype=$(echo $x1 | cut -f 3 -d " ") + fi + + # check for journal device + if [ "$fsopts" -a -z "$journaldev" ] ; then + jdev=${fsopts#*,jdev=} + if [ "$jdev" != "$fsopts" ] ; then + journaldev=${jdev%%,*} + fi + logdev=${fsopts#*,logdev=} + if [ "$logdev" != "$fsopts" ] ; then + journaldev=${logdev%%,*} + fi + fi + + # check for nfs root and set the fstype accordingly + case "$dev" in + /dev/nfs) + fstype=nfs + ;; + /dev/*) + if [ ! -e "$dev" ]; then + error 1 "$name device ($dev) not found" + fi + ;; + *://*) # URL type + fstype=${dev%%://*} + interface=${interface:-default} + ;; + scsi:*) + ;; + *:*) + fstype=nfs + interface=${interface:-default} + ;; + esac + + if [ -z "$fstype" ]; then + eval $(udevadm info -q env -n $dev | sed -n '/ID_FS_TYPE/p' ) + fstype=$ID_FS_TYPE + [ $? -ne 0 ] && fstype= + [ "$fstype" = "unknown" ] && $fstype= + ID_FS_TYPE= + fi + + if [ ! "$fstype" ]; then + error 1 "Could not find the filesystem type for $name device $dev + + Currently available -d parameters are: + Block devices /dev/<device> + NFS <server>:<path> + URL <protocol>://<path>" + fi + + # We assume that we always have to load a module for the fs + mod=$fstype - # get rootdev via stat - rootcpio=`echo / | /bin/cpio --quiet -o -H newc` - rootmajor="$(echo $(( 0x${rootcpio:62:8} )) )" - rootminor="$(echo $(( 0x${rootcpio:70:8} )) )" - - # get opts from fstab and device too if stat failed - sed -e '/^[ \t]*#/d' < $root_dir/etc/fstab >"$work_dir/pipe" - while read fstab_device fstab_mountpoint fstab_type fstab_options dummy ; do - if [ "$fstab_mountpoint" = "/" ]; then - update_blockdev "$fstab_device" # get major and minor - # let's see if the stat device is the same as the fstab device - if [ "$rootmajor" -eq 0 ] || [ "$blockmajor" -eq "$rootmajor" -a "$blockminor" -eq "$rootminor" ]; then # if both match - rootdev="$fstab_device" # use the fstab device so the user can decide - # how to access the root device - fi - rootfstype="$fstab_type" - rootfsopts="$fstab_options" - break - fi - done < "$work_dir/pipe" - - if [ $((rootmajor)) -gt 0 -a -z "$rootdev" ] ; then - # don't check for non-device mounts - rootdev="$(majorminor2blockdev $rootmajor $rootminor)" - if [ -z "$rootdev" ]; then - error 1 "Cannot determine the root device" - fi - update_blockdev $rootdev - rootdev="$(beautify_blockdev $rootdev)" - fi -fi - -#if we don't know where the root device belongs to -if [ -z "$rootfstype" ] ; then - # get type from /etc/fstab or /proc/mounts (actually not needed) - x1=$(cat $root_dir/etc/fstab /proc/mounts 2>/dev/null \ - | grep -E "$rootdev[[:space:]]" | tail -n 1) - rootfstype=$(echo $x1 | cut -f 3 -d " ") -fi - -# check for journal device -if [ "$rootfsopts" -a -z "$journaldev" ] ; then - jdev=${rootfsopts#*,jdev=} - if [ "$jdev" != "$rootfsopts" ] ; then - journaldev=${jdev%%,*} - fi - logdev=${rootfsopts#*,logdev=} - if [ "$logdev" != "$rootfsopts" ] ; then - journaldev=${logdev%%,*} + # Check if we have to load a module for the fs type + # XXX: This check should happen more generically for all modules + if [ ! "$(find $root_dir/lib/modules/$kernel_version/ -name $fstype.ko -o -name $fstype.ko.gz)" ]; then + if grep -q ${fstype}_fs_type $map ; then + # No need to load a module, since this is compiled in + mod= + fi fi -fi + # Now save the rootXXX or usrXXX variables + + read $var_dev < <(echo "$dev") + read $var_fstype < <(echo "$fstype") + read $var_fsopts < <(echo "$fsopts") + read $var_major < <(echo "$major") + read $var_minor < <(echo "$minor") + rootfsmod="$rootfsmod $mod" +} + +resolve_mountpoint root / +resolve_mountpoint usr /usr # WARNING: dirty hack to get the resume device of the current system for o in $(cat /proc/cmdline); do @@ -316,57 +393,6 @@ esac done -# check for nfs root and set the rootfstype accordingly -case "$rootdev" in - /dev/nfs) - rootfstype=nfs - ;; - /dev/*) - if [ ! -e "$rootdev" ]; then - error 1 "Root device ($rootdev) not found" - fi - ;; - *://*) # URL type - rootfstype=${rootdev%%://*} - interface=${interface:-default} - ;; - scsi:*) - ;; - *:*) - rootfstype=nfs - interface=${interface:-default} - ;; -esac - -if [ -z "$rootfstype" ]; then - eval $(udevadm info -q env -n $rootdev | sed -n '/ID_FS_TYPE/p' ) - rootfstype=$ID_FS_TYPE - [ $? -ne 0 ] && rootfstype= - [ "$rootfstype" = "unknown" ] && $rootfstype= - ID_FS_TYPE= -fi - -if [ ! "$rootfstype" ]; then - 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 - -# We assume that we always have to load a module for the rootfs -rootfsmod=$rootfstype - -# Check if we have to load a module for the rootfs type -# XXX: This check should happen more generically for all modules -if [ ! "$(find $root_dir/lib/modules/$kernel_version/ -name $rootfstype.ko -o -name $rootfstype.ko.gz)" ]; then - if grep -q ${rootfstype}_fs_type $map ; then - # No need to load a module, since this is compiled in - rootfsmod= - fi -fi - # blockdev is the list current block devices. # It will get modified by the various scrips as they descend through # the device setup, starting with the mount information @@ -374,11 +400,13 @@ fallback_rootdev="$rootdev" save_var fallback_rootdev -save_var rootdev +for name in root usr; do + save_var ${name}dev + save_var ${name}fsopts + save_var ${name}fstype +done save_var resumedev save_var journaldev save_var dumpdev -save_var rootfsopts -save_var rootfstype -blockdev="$(resolve_device Root $rootdev) $(resolve_device Resume $resumedev) $(resolve_device Journal $journaldev) $(resolve_device Dump $dumpdev)" +blockdev="$(resolve_device Root $rootdev) $(resolve_device /usr $usrdev) $(resolve_device Resume $resumedev) $(resolve_device Journal $journaldev) $(resolve_device Dump $dumpdev)" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org