DLDI patch for RAM/no RAM

Troy Davis troy_ed at yahoo.com
Sun May 6 04:26:49 CEST 2007


> 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


Ok figured it out here is a new patch to rc.common ignore previous one.
It will start gpm and 2 extra terminals if extra RAM is detected.

Index: vendors/Nintendo/common/rc.common
===================================================================
--- vendors/Nintendo/common/rc.common (revision 1751)
+++ vendors/Nintendo/common/rc.common (working copy)
@@ -55,11 +55,21 @@
 # set up /etc/hosts so networking tools will work
 echo "127.0.0.1 $hostname" > /etc/hosts
 
+# if we have a extra RAM then enable gpm and 2 extra terminals
+exec 0</proc/meminfo
+read line
+exec 0</dev/null
+set -- $line
+if [ $2 -gt 4000 ]
+then
+              /usr/bin/agetty -n -l /bin/autologin 38400 tty2&
+              /usr/bin/agetty -n -l /bin/autologin 38400 tty3&
 # if we have a gpm binary, enable the mouse cursor
 if [ -x /usr/bin/gpm ]
 then
  /usr/bin/gpm -m /dev/mouse0 -t ps2 &
 fi
+fi
 
 # show firmware version if configured
 [ "$show_firmware_version" = "YES" ] && fwve

Thanks,
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/20070505/69e96475/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RAM.diff.gz
Type: application/x-gzip
Size: 438 bytes
Desc: not available
Url : http://mailman.dslinux.in-berlin.de/pipermail/dslinux-devel-dslinux.in-berlin.de/attachments/20070505/69e96475/attachment.bin 


More information about the dslinux-devel mailing list