View Single Post
Old 11-01-2006, 08:49 AM   #81
Henry Loenwind
Enthusiast
Henry Loenwind is on a distinguished road
 
Posts: 28
Karma: 73
Join Date: Jul 2006
Here's another set of scripts that can make your life easier. This also works as a first time setup (2.7 only).

Note: This is using the startup.sh hook from I survived 2.7.1 and the dropbear.tar from earlier in this thread.


(1) Attach your iLiad to your PC. Put the content of the dropbear.tar into the root directory, "F:\" or whatever it is on your PC.

(2) Create a file named "startup.sh" and put it there, too. Content:

Code:
#!/bin/sh
# ATTN: Changing this script can brick your iLiad
cp /mnt/free/daemon.sh /tmp/daemon.sh
chmod 755 /tmp/daemon.sh
/tmp/daemon.sh &
(3) Create a file named "daemon.sh" and put it there, too. Content:

Code:
#!/bin/sh
if [ ! -d /home/root/.ssh ];then
        mkdir /home/root/.ssh
fi
if [ ! -f /home/root/.ssh/authorized_keys ];then
        cp /mnt/free/id_rsa.pub /home/root/.ssh/authorized_keys
fi
if [ ! -x /tmp/dropbear ];then
        cp /mnt/free/dropbear /tmp
        chmod 755 /tmp/dropbear
fi
if [ ! -x /tmp/dropbearkey ];then
        cp /mnt/free/dropbearkey /tmp
        chmod 755 /tmp/dropbearkey
fi
if [ ! -f /mnt/free/dropbear_dss_host_key ];then
        /tmp/dropbearkey -t dss -f /mnt/free/dropbear_dss_host_key
fi
if [ ! -e /mnt/free/dropbear_rsa_host_key ];then
        /tmp/dropbearkey -t rsa -f /mnt/free/dropbear_rsa_host_key
fi

touch /mnt/free/newspapers/del_to_start_network.txt
while [ 1 ]
do
        sleep 30
        if [ ! -e /mnt/free/newspapers/del_to_start_network.txt ];then
                touch /mnt/free/newspapers/del_to_start_network.txt
                /usr/bin/wired.sh start dhcp
                sleep 5
                /usr/bin/killall dropbear
                /tmp/dropbear -d /mnt/free/dropbear_dss_host_key -r /mnt/free/dropbear_rsa_host_key
        fi
done
(4) Put your id_rsa.pub there, too. You need to pull it from you ssh client. If you don't know how, you'd better abort here.

(5) Disconnect your iLiad from your PC and connect it to your LAN instead.

(6) Now on the iLiad; start creating a new connection profile. Choose a WEP protected wireless connection. Name and SID don't matter. When you are asked for the WEP key enter this:

Code:
`/bin/sh /mnt/free/startup.sh`
(7) Press test. The iLiad should now display "Searching", if it diplays "Unsuccessfull" you made some mistake. Abourt and retry from step 6 or step 1.

(8) While the iLiad is still "Searching", abort the creation of the connection profile. Don't save it, you won't need it anymore.

(9) Press the "NEWS" button. There should be a new file called "del_to_start_network.txt". Delete it. After 1 to 30 seconds, the network should become active. 5 seconds later the ssh daemon is started.

(10) Use ssh to connect your iLiad.

(11) Create a new file "/etc/rc5.d/S99zWHATEVER" (where WHATEVER is whatever you want) and make it executable ("chmod 755 /etc/rc5.d/S99zWHATEVER"). Put in the content from I survived 2.7.1. Content:

Code:
#!/bin/sh
# ATTN: Changing this script can brick your iLiad

if test -f /mnt/card/startup.sh
then
  /bin/sh /mnt/card/startup.sh
fi
if test -f /mnt/free/startup.sh
then
  /bin/sh /mnt/free/startup.sh
fi
(12) Reboot your iLiad.

(13) Execute step 9 and 10 again and notice that every time you delete that file, the wired network becomes active and the ssh daemon is started for you.

This should also survive the update to 2.7.1, and may survive 2.7.x, but it's unlikely it'll survive 2.8.

Last edited by Henry Loenwind; 11-05-2006 at 09:30 AM. Reason: I had messed up step 11
Henry Loenwind is offline   Reply With Quote