This tutorial covers some features you might want integrate into your memorycard-linux. Before you can use it, you need a working no-hdd memorycard. If you do not have one yet, you should go through the tutorial at
http://playstation2-linux.com/download/nohdd/ps2nohdd.html
Before you can work with the ps2-pads you need to do two things: Create the device-files and load the kernel-modules at startup.
Change to the "dev"-directory of your initrd and issue following commands:
mknod ps2pad00 c 244 0 mknod ps2pad10 c 244 16 mknod ps2padstat c 244 255
Now copy the files "joystick.o" and "ps2pad.o" from the subdirectories of /lib/modules to the "modules"-directory of your initrd. (Create this directory if you do not have it.)
Also make sure that you have "insmod" in the initrd-"sbin"-directory.
If you have configured your kernel differently, you might not find these modules on your harddisk. This either means that they are already compiled into your kernel, or you have disabled them. In the latter case you will have to reconfigure and rebuild the kernel.
Then you need to execute
insmod /modules/joystick.o insmod /modules/ps2pad.oduring startup. If you have a startupscript, place them in there.
Usually you have to kill your memcard-linux by holding the reset-button down for a few seconds. This might not be the behaviour you want or the user expects. If you instead want your linux to immediately power down or want it to unmount the memorycard first, then you are reading the right tutorial.
Edit the file etc/inittab on your initrd and place the following line into it:
pf::powerfail:/stopscript
Now create the file "stopscript" in the root-directory of your initrd and fill it with
#!/bin/sh /sbin/poweroff -d -f #--end of file--#Don't forget to set the script executable with "chmod 755 stopscript"
Finally you need to copy "poweroff" from /sbin to the "sbin"-directory of your initd.
Setting up your network-adapter and setting up the IP-address via DHCP is easier than you might think. For this you need 4 things: The smap-kernel-module, the af_packet kernel module, ipconfig and dhcpcd.
First copy "ifconfig" and "dhcpcd" over to the "sbin"-directory of your initrd.
Then copy the files "af_packet.o" and "smap.o" from the subdirectories of /lib/modules to the "modules"-directory of your initrd. (Create this directory if you do not have it.) Also make sure that you have "insmod" in the initrd-"sbin"-directory.
Depending on your kernel-configuration, you might not find these modules on your harddisk. This either means that they are already compiled into your kernel, or you have disabled them. In the latter case you will have to reconfigure and rebuild the kernel.
Then you need to execute
insmod /modules/af_packet.o insmod /modules/smap.o dhcpcd eth0during startup. If you have a startupscript, place them in there.
That's all folks
Mr.M
Copyright (C) 2004 Michael Mahr (Michael.Mahr@fh-joanneum.at)