#!/bin/sh # CUSTOMIZE THIS SECTION ip_address=192.168.1.33 netmask=255.255.255.0 gateway=192.168.1.33 sharename="//Gosha-ΟΚ/ps2linux" username="Guest" password="pwd" # sleep 5 #echo " Enter X to drop to shell prompt, any other entry to continue:" #read -p " > " leave #if [ "$leave" = "X" ]; then # exec bash #fi error_exit() { echo >&2 "Boot failed, running bash..." exec bash } ifconfig eth0 $ip_address netmask $netmask ifconfig eth0 up route add default gw $gateway sleep 3 echo "Mounting /smb/ps2linux_loop on /newroot" smbmount $sharename /smb -o rw,username=$username,password=$password sleep 3 mount -t ext3 -o loop /smb/ps2linux_loop /newroot || error_exit sleep 3 cp /etc/hosts /newroot/etc cp /etc/resolv.conf /newroot/etc cp /etc/network/interfaces /newroot/etc/network echo "mount -t smbfs -o username=$username,password=$password $sharename /mnt/smb" > /newroot/etc/init.d/smbswap echo "losetup /dev/loop1 /mnt/smb/swapfile" >> /newroot/etc/init.d/smbswap echo "swapon /dev/loop1" >> /newroot/etc/init.d/smbswap cd /newroot/etc/init.d chmod 755 smbswap cd / if [ ! -d "/newroot/oldroot" ]; then mkdir /newroot/oldroot || error_exit fi #exec bash echo "Changing root." pivot_root /newroot /newroot/oldroot || error_exit umount /oldroot/proc echo "Starting init." exec /sbin/init "$@"