summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2006-09-04 18:54:59 +0200
committermaximilian attems <maks@debian.org>2006-09-04 18:54:59 +0200
commitcf4bba337d69510c4551ba84e8c69562873ea93f (patch)
treea57a27fa39693b3a39d57aa3a1bf4cb6e6b30d52
parent8ae9783215c2845b50dfb70b919df0753c2b0dd9 (diff)
- better nfs handling: merge vagrant branch :) + local changes
- cleanup stupid whitespace all over the place
-rw-r--r--debian/changelog23
-rwxr-xr-xinit4
-rw-r--r--initramfs.conf.54
-rwxr-xr-xmkinitramfs10
-rw-r--r--scripts/local2
-rwxr-xr-xscripts/local-top/mdrun2
-rw-r--r--scripts/nfs35
-rw-r--r--update-initramfs.84
8 files changed, 50 insertions, 34 deletions
diff --git a/debian/changelog b/debian/changelog
index b46db63..1f00b6d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,11 +8,26 @@ initramfs-tools (0.78) unstable; urgency=medium
* debian/scripts: Add /etc/kernel-img.conf section, as update-initramfs
needs to act according to it.
- -- maximilian attems <maks@sternwelten.at> Thu, 31 Aug 2006 14:44:01 +0200
+ * scripts/nfs: Fix parsing of etherboot ip options. Based on a patch by
+ to Vagrant Cascadian <vagrant+bugs@freegeek.org>. (closes: 385252)
+
+ * scripts/nfs: No need to duplicate work of ntfsmount. Thanks for the patch
+ to Vagrant Cascadian <vagrant+bugs@freegeek.org>. (closes: 385226)
+
+ * scripts/nfs: Add an sleep 0.1 in the retry loop to slow down retry
+ attempts. Only log "Retrying .." after first run. Use init variable.
+ (closes: 385624)
+
+ * init: Reorder the early mknod after tmpfs mount. (closes: 385641)
+
+ * initramfs.conf.5, mkinitramfs, scripts/local, scripts/local-top/mdrun,
+ scripts/nfs, update-initramfs.8, debian/changelog: Whitespace policy.
+
+ -- maximilian attems <maks@sternwelten.at> Mon, 4 Sep 2006 17:38:13 +0200
initramfs-tools (0.77b) unstable; urgency=high
- * mkinitramfs: Fix destination of mdrun.conf. Thanks for the report to
+ * mkinitramfs: Fix destination of mdrun.conf. Thanks for the report to
Scott Glenn <s103@webmasters.com>. Urgency high as broken in testing
too and needed for partial mdadm upgrades. (closes: 385406)
@@ -1347,7 +1362,7 @@ initramfs-tools (0.36ubuntu1) dapper; urgency=low
initramfs-tools (0.36) unstable; urgency=low
"Sunny Autumn Release"
-
+
* Minor cleanups in mkiniramfs.
* Remove manpage section about return values. Needs to be rephrased.
@@ -1850,7 +1865,7 @@ initramfs-tools (0.13) breezy; urgency=low
Use DESTDIR instead of TMPDIR
Add ability to link in extra hunks into the cpio file
Cosmetic cleanups
-
+
* scripts/functions: Add lsb stype log_FOO_msg functions
* scripts/local: Add logging
diff --git a/init b/init
index 0c336b3..85f6291 100755
--- a/init
+++ b/init
@@ -4,8 +4,6 @@ echo "Loading, please wait..."
[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir --mode=0700 /root
-[ -e /dev/console ] || mknod /dev/console c 5 1
-[ -e /dev/null ] || mknod /dev/null c 1 3
[ -d /sys ] || mkdir /sys
[ -d /proc ] || mkdir /proc
[ -d /tmp ] || mkdir /tmp
@@ -20,6 +18,8 @@ if [ -e /etc/udev/udev.conf ]; then
. /etc/udev/udev.conf
fi
mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev
+[ -e /dev/console ] || mknod /dev/console c 5 1
+[ -e /dev/null ] || mknod /dev/null c 1 3
> /dev/.initramfs-tools
mkdir /dev/.initramfs
diff --git a/initramfs.conf.5 b/initramfs.conf.5
index 8d6b621..89e9f4b 100644
--- a/initramfs.conf.5
+++ b/initramfs.conf.5
@@ -1,4 +1,4 @@
-.TH INITRAMFS.CONF 5 "$Date: 2005/12/06 $" "" "initramfs.conf manual"
+.TH INITRAMFS.CONF 5 "$Date: 2006/09/02 $" "" "initramfs.conf manual"
.SH NAME
initramfs.conf \- configuration file for mkinitramfs
@@ -35,7 +35,7 @@ The default setting is \fImost\fP.
.TP
\fB BUSYBOX
Include busybox utilities for the boot scripts.
-If set to 'n'
+If set to 'n'
.B mkinitramfs
will build an initramfs whithout busybox.
Beware that many boot scripts need busybox utilities.
diff --git a/mkinitramfs b/mkinitramfs
index c36e845..8d5911d 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -242,11 +242,11 @@ if [ -x /sbin/mdadm ] && [ ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then
echo "rootraiddev=${rootraiddev}" > ${DESTDIR}/conf/mdrun.conf
mdadm=$(mdadm --detail "${rootraiddev}")
echo "${mdadm}" | awk '
- $1 == "Number" && $2 == "Major" { start = 1; next }
- $1 == "UUID" { print "uuid=" $3; next }
- !start { next }
- $2 == 0 && $3 == 0 { next }
- { devices = devices " " $NF }
+ $1 == "Number" && $2 == "Major" { start = 1; next }
+ $1 == "UUID" { print "uuid=" $3; next }
+ !start { next }
+ $2 == 0 && $3 == 0 { next }
+ { devices = devices " " $NF }
END { print "devices='\''" devices "'\''" }' \
>> ${DESTDIR}/conf/mdrun.conf
copy_exec /sbin/mdadm /sbin
diff --git a/scripts/local b/scripts/local
index e7bf23e..299fc65 100644
--- a/scripts/local
+++ b/scripts/local
@@ -48,7 +48,7 @@ mountroot ()
# Get the root filesystem type if not set
if [ -z "${ROOTFSTYPE}" ]; then
eval $(fstype < ${ROOT})
- else
+ else
FSTYPE=${ROOTFSTYPE}
fi
diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun
index da890c5..f733656 100755
--- a/scripts/local-top/mdrun
+++ b/scripts/local-top/mdrun
@@ -16,7 +16,7 @@ prereqs)
esac
if [ -e /scripts/local-top/mdadm ]; then
- exit 0
+ exit 0
fi
unset raidlvl
diff --git a/scripts/nfs b/scripts/nfs
index f42ed22..c66e2a1 100644
--- a/scripts/nfs
+++ b/scripts/nfs
@@ -2,6 +2,8 @@
# FIXME This needs error checking
+retry_nr=0
+
# parse nfs bootargs + launch ipconfig and nfsmount
do_nfsmount()
{
@@ -20,19 +22,21 @@ do_nfsmount()
*)
ipconfig -d $IPOPTS
- # grab device entry from full line
+ # grab device entry from ip option
NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
- NEW_DEVICE=${NEW_DEVICE%:*}
+ if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
+ NEW_DEVICE=${NEW_DEVICE%:*}
+ else
+ # wrong parse, possibly only a partial string
+ NEW_DEVICE=
+ fi
if [ -n "${NEW_DEVICE}" ]; then
DEVICE="${NEW_DEVICE}"
fi
- # grab server-ip
- SERVER_IP=${IPOPTS#*:}
- SERVER_IP=${SERVER_IP%:*:*:*:*:*:*}
;;
esac
-
- # FIXME: source ipconfig output - might overwrite aboves
+
+ # source relevant ipconfig output
. /tmp/net-${DEVICE}.conf
# get nfs root from dhcp
@@ -45,13 +49,8 @@ do_nfsmount()
NFSOPTS="-o ${NFSROOT#*,}"
fi
NFSROOT=${NFSROOT%%,*}
- # server-ip could be passed by ip
if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
- if [ -n "${SERVER_IP}" ]; then
- NFSROOT="${SERVER_IP}:${NFSROOT}"
- else
- NFSROOT=${ROOTSERVER}:${ROOTPATH}
- fi
+ NFSROOT=${ROOTSERVER}:${NFSROOT}
fi
fi
@@ -92,13 +91,15 @@ mountroot()
fi
# loop until nfsmount succeds
- # FIXME: another place of init bin hardcoding
- while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}/sbin/init ]; do
+ while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}${init} ]; do
+ [ ${retry_nr} -gt 0 ] && \
[ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount"
- do_nfsmount
+ do_nfsmount
# FIXME: ipconfig loops every min at least - better param??
delay=$(( ${delay} - 1 ))
- [ "$quiet" != "y" ] && log_end_msg
+ [ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg
+ [ ! -e ${rootmnt}/sbin/init ] && /bin/sleep 0.1
+ retry_nr=$(( ${retry_nr} + 1 ))
done
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
diff --git a/update-initramfs.8 b/update-initramfs.8
index 7cfc206..fa1728a 100644
--- a/update-initramfs.8
+++ b/update-initramfs.8
@@ -1,4 +1,4 @@
-.TH UPDATE-INITRAMFS 8 "$Date: 2006/02/17" $" "" "update-initramfs manual"
+.TH UPDATE-INITRAMFS 8 "$Date: 2006/09/02" $" "" "update-initramfs manual"
.SH NAME
update-initramfs \- generate an initramfs image
@@ -67,7 +67,7 @@ The initramfs-tools are written by Jeff Bailey <jbailey@ubuntu.com>.
This manual is maintained by Maximilian Attems <maks@sternwelten.at>.
.SH SEE ALSO
-.BR
+.BR
.IR initramfs.conf (5),
.IR initramfs-tools (8),
.IR mkinitramfs (8).