if [ -n "$bootparam_root" ]; then
debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..."
- if [ "${bootparam_root:0:5}" = "UUID=" ]; then
- bootparam_root="/dev/disk/by-uuid/${bootparam_root/UUID=/}"
+ if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
+ root_uuid=`echo $bootparam_root | cut -c6-`
+ bootparam_root="/dev/disk/by-uuid/$root_uuid"
fi
if [ -e "$bootparam_root" ]; then
# populate bootparam environment
for p in `cat /proc/cmdline`; do
- opt="${p%%=*}"
- opt=${opt/-/_}
- if [ "${p/=/}" = "$p" ]; then
+ opt=`echo $p | cut -d'=' -f1`
+ opt=`echo $opt | sed -e 's/-/_/'`
+ if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
eval "bootparam_${opt}=true"
else
- eval "bootparam_${opt}=\"${p#*=}\""
+ value="`echo $p | cut -d'=' -f2-`"
+ eval "bootparam_${opt}=\"${value}\""
fi
done
# Load and run modules
for m in $MODULES_DIR/*; do
# Skip backup files
- if [ "${m/\~/}" != "$m" ]; then
+ if [ "`echo $m | sed -e 's/\~$//'`" = "$m" ]; then
continue
fi
done
# process module
- source $m
+ . $m
if ! eval "${module}_enabled"; then
debug "Skipping module $module"