DLDI patch for RAM/no RAM

Troy Davis troy_ed at yahoo.com
Thu May 3 07:18:40 CEST 2007


Index: vendors/Nintendo/common/rc.common
===================================================================
--- vendors/Nintendo/common/rc.common	(revision 1748)
+++ vendors/Nintendo/common/rc.common	(working copy)
@@ -58,8 +58,14 @@
 # if we have a gpm binary, enable the mouse cursor
 if [ -x /usr/bin/gpm ]
 then
+exec 0</proc/meminfo
+read line
+exec 0</dev/tty
+set -- $line
+if [ $2 -gt 4000 ]; then
 	/usr/bin/gpm -m /dev/mouse0 -t ps2 &
 fi
+fi
 
 # show firmware version if configured
 [ "$show_firmware_version" = "YES" ] && fwver

Thanks to John from the dslinux.org forums for the shell code for this. http://www.dslinux.org/index.php?showtopic=2018&st=180#

This will if it detects extra RAM, will run gpm if its available

Maybe we should set a environment variable if extra RAM is detected so instead of having to run the script each time it could be checked against the environment variable instead ?

I was trying to do something like this in inittab to make 3 terminals available for RAM users or 1 if extra RAM not detected but doesn't work.

I get error
/dev/tty: cannot open

so don't use the below diff 

Index: vendors/Nintendo/DLDI/inittab
===================================================================
--- vendors/Nintendo/DLDI/inittab	(revision 1748)
+++ vendors/Nintendo/DLDI/inittab	(working copy)
@@ -1,2 +1,9 @@
 tty1::linux:/usr/bin/agetty -n -l /bin/autologin 38400 tty1
-
+exec 0</proc/meminfo
+read line
+exec 0</dev/tty
+set -- $line
+if [ $2 -gt 4000 ]; then
+tty2::linux:/usr/bin/agetty -n -l /bin/autologin 38400 tty2
+tty3::linux:/usr/bin/agetty -n -l /bin/autologin 38400 tty3
+fi

Troy(GPF)
http://gpf.dcemu.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.dslinux.in-berlin.de/pipermail/dslinux-devel-dslinux.in-berlin.de/attachments/20070502/bbdc3091/attachment.htm 


More information about the dslinux-devel mailing list