Kaydet (Commit) ea17c620 authored tarafından Your Name's avatar Your Name

cmdline safety

üst 2d90cde9
......@@ -29,10 +29,15 @@ mount_handler(){
fi
export memtotal=$(cat /proc/meminfo | grep MemTotal | sed "s/.* //" | sed "s/ .*//g")
}
trim_valiable(){
echo "$@" | while read -n 1 c ; do
[[ "$c" =~ [^a-zA-Z0-9=iI] ]] || echo -n $c
done
}
parse_cmdline(){
for i in $(cat /proc/cmdline)
do
export $i || true
export $(trim_variable $i) || true
done
}
......
......@@ -16,7 +16,7 @@ load_modules(){
sh /load_modules.sh &>/dev/null
}
if [ -x /xbin/udevd -a -x /xbin/udevadm ] && [ "$noudev" != "true" ]; then
if [ -x /xbin/udevd -a -x /xbin/udevadm ] && [ -n "$noudev" ]; then
msg "Triggering udev"
mdev -s
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment