Friday, 18 January 2008

NSLU2 on flash - script +not+ broken :-D

Update: Why don't I learn my lesson and stop working too late? Making a fool of myself in public isn't something to be proud of.

Ignore this post if you're seeing it for the first time.




Martin, David, this script is broken. When trying to set kernel parameters, there should be a new line, it shouldn't be explicitly removed. I know it looks weird, but this seems to be proven by this output:


kinder:/etc/init.d# ./params4flash start
kinder:/etc/init.d# cat params4flash
#! /bin/sh

exit 0

PATH=/sbin:/bin

# Max time to wait for writeout
MAX_AGE=120
CENT_AGE=$((100 * $MAX_AGE))
# Max percent of mem to use for dirty pages
DRATIO=10
# Once we write, do so until this many percent of mem is still in use
DBRATIO=1

case "$1" in
start)
echo -n 0 >> /proc/sys/vm/swappiness
echo -n $MAX_AGE >> /proc/sys/vm/laptop_mode
echo -n $CENT_AGE >> /proc/sys/vm/dirty_writeback_centisecs
echo -n $CENT_AGE >> /proc/sys/vm/dirty_expire_centisecs
echo -n $DRATIO >> /proc/sys/vm/dirty_ratio
echo -n $DBRATIO >> /proc/sys/vm/dirty_background_ratio
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
exit 0
kinder:/etc/init.d# cat /proc/sys/vm/swappiness
60

1 comment:

David Härdeman said...

Third line of the script is "exit 0"...