summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2006-07-02 18:57:07 +0200
committermaximilian attems <maks@debian.org>2006-07-02 18:57:07 +0200
commit0d341b8d32810844ce035e89a9e60fb7a7dde4b6 (patch)
tree55a7b2d2fe9e9cde049c1e7962b3baef00107c5b /scripts
parent09276c4c9f7deb9a46cf162747b5749f94738c2b (diff)
downloadinitramfs-tools-0d341b8d32810844ce035e89a9e60fb7a7dde4b6.tar.gz
initramfs-tools-0d341b8d32810844ce035e89a9e60fb7a7dde4b6.zip
woow pile of stuff turned up:
- cleanup of activate_vg() in lvm boot script - use less of busybox utilities - conf.d for BUSYBOX=y usage for the packages - don't poke on conffile for RESUME - use printf instead of expr (ooh ash and dash are *fun*) - fix update-initramfs to use current_version when no other version exists around
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions16
-rw-r--r--scripts/local2
-rwxr-xr-xscripts/local-top/lvm11
3 files changed, 19 insertions, 10 deletions
diff --git a/scripts/functions b/scripts/functions
index a4faaa8..fea6956 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -220,14 +220,16 @@ load_modules()
{
if [ -e /conf/modules ]; then
cat /conf/modules | while read m; do
- if [ -z "$m" ] \
- || expr "$m" : "#" >/dev/null \
- || expr "$m" : "[ \t]+#?" > /dev/null
- then
- continue;
- else
- modprobe -q $m
+ # Skip empty lines
+ if [ -z "$m" ]; then
+ continue
fi
+ # Skip comments - d?ash removes whitespace prefix
+ com=$(printf "%.1s" "${m}")
+ if [ "$com" = "#" ]; then
+ continue
+ fi
+ modprobe -q $m
done
fi
}
diff --git a/scripts/local b/scripts/local
index 25aca70..a565885 100644
--- a/scripts/local
+++ b/scripts/local
@@ -55,7 +55,7 @@ mountroot ()
# Mount root
mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt}
- [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/log-bottom"
+ [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom"
run_scripts /scripts/local-bottom
[ "$quiet" != "y" ] && log_end_msg
}
diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm
index fc1036e..5323a7d 100755
--- a/scripts/local-top/lvm
+++ b/scripts/local-top/lvm
@@ -21,7 +21,7 @@ activate_vg()
# Make sure that we have a non-empty argument
if [ -z "${vg}" ]; then
- return 0
+ return 1
fi
# Take care of lilo boot arg, risky activating of all vg
@@ -40,7 +40,12 @@ activate_vg()
# Make sure that we have a d-m path
vg=${vg#/dev/mapper/}
if [ "$vg" = "$1" ]; then
- return 0
+ return 1
+ fi
+
+ # Make sure that the device includes at least one dash
+ if [ "$(echo -n "$vg" | tr -d -)" = "$vg" ]; then
+ return 1
fi
# Split volume group from logical volume.
@@ -61,3 +66,5 @@ modprobe -q dm-mirror
activate_vg "$ROOT"
activate_vg "$resume"
+
+exit 0