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

cmdline safety

üst 2d90cde9
...@@ -29,10 +29,15 @@ mount_handler(){ ...@@ -29,10 +29,15 @@ mount_handler(){
fi fi
export memtotal=$(cat /proc/meminfo | grep MemTotal | sed "s/.* //" | sed "s/ .*//g") 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(){ parse_cmdline(){
for i in $(cat /proc/cmdline) for i in $(cat /proc/cmdline)
do do
export $i || true export $(trim_variable $i) || true
done done
} }
......
...@@ -16,7 +16,7 @@ load_modules(){ ...@@ -16,7 +16,7 @@ load_modules(){
sh /load_modules.sh &>/dev/null 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" msg "Triggering udev"
mdev -s 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