summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog10
-rw-r--r--scripts/local36
2 files changed, 37 insertions, 9 deletions
diff --git a/debian/changelog b/debian/changelog
index 032fa85..042cf8d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,8 +16,14 @@ initramfs-tools (0.88) UNRELEASED; urgency=low
* hook-functions: Document how copy_exec determines the target path.
* hook-functions: Add firmware loading support to manual_add_modules().
(closes: #355881)
-
- -- maximilian attems <maks@debian.org> Thu, 03 May 2007 18:43:14 +0200
+ * scripts/local: Ubuntu merge
+ - As well as waiting for the existance of the root device node, also check
+ to see whether we have a filesystem of some kind on it. Some devices
+ nodes (devmapper/LVM/EVMS, mdadm) will exist before they can be safely
+ used. Patch by Scott James Remnant <scott@ubuntu.com>. Changed to
+ support both fstype and vol_id.
+
+ -- maximilian attems <maks@debian.org> Sun, 27 May 2007 00:26:17 +0200
initramfs-tools (0.87b) unstable; urgency=low
diff --git a/scripts/local b/scripts/local
index 4e01472..459ba8d 100644
--- a/scripts/local
+++ b/scripts/local
@@ -1,5 +1,29 @@
# Local filesystem mounting -*- shell-script -*-
+# Parameter: device node to check
+# Echos fstype to stdout
+# Return value: indicates if an fs could be recognized
+get_fstype ()
+{
+ local FS FSTYPE FSSIZE RET
+ FS="${1}"
+
+ # vol_id has a more complete list of file systems
+ if [ -x /lib/udev/vol_id ]; then
+ FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null)
+ else
+ eval $(fstype < "${FS}" 2> /dev/null)
+ fi
+ RET=$?
+
+ if [ -z "${FSTYPE}" ]; then
+ FSTYPE="unknown"
+ fi
+
+ echo "${FSTYPE}"
+ return ${RET}
+}
+
# Parameter: Where to mount the filesystem
mountroot ()
{
@@ -9,7 +33,7 @@ mountroot ()
# If the root device hasn't shown up yet, give it a little while
# to deal with removable devices
- if [ ! -e "${ROOT}" ]; then
+ if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null); then
log_begin_msg "Waiting for root file system..."
# Default delay is 180s
@@ -23,9 +47,11 @@ mountroot ()
fi
slumber=$(( ${slumber} * 10 ))
- while [ ${slumber} -gt 0 ] && [ ! -e "${ROOT}" ]; do
+ while [ ! -e "${ROOT}" ] \
+ || ! $(get_fstype "${ROOT}" >/dev/null); do
/bin/sleep 0.1
slumber=$(( ${slumber} - 1 ))
+ [ ${slumber} -gt 0 ] || break
done
if [ ${slumber} -gt 0 ]; then
@@ -47,14 +73,10 @@ mountroot ()
# Get the root filesystem type if not set
if [ -z "${ROOTFSTYPE}" ]; then
- eval $(fstype < ${ROOT})
+ FSTYPE=$(get_fstype "${ROOT}")
else
FSTYPE=${ROOTFSTYPE}
fi
- if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then
- FSTYPE=$(/lib/udev/vol_id -t ${ROOT})
- [ -z "$FSTYPE" ] && FSTYPE="unknown"
- fi
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount"
run_scripts /scripts/local-premount