#!/bin/sh ###DEFAULTS### #Intimate boot script #Originally programmed by Tangent #Hacked by: Disconnect and prh #Current Version... #Rewritten and Hacked by: NSCo #This WILL work with ext2 or ext3 on /dev/hda1 #My setting, if anything goes wrong you can always try these # /dev/hda1 - Intimate installed on ext2 # /dev/hda2 - Swap (most likely not needed) # /dev/hda3 - you can add more partitions if you want i have a fat32 partition here # make sure you have enough space on your /dev/hda1 partiton # i have allocated 650 meg #Original Script - please ignore all commented scripting #This script has be optimized to work with fam v6 (the newest image) #If you know what you're doing, change what you need to make this script work. #but it should already work with these settings. #there are a lot of time outs please be patient, they're there for a reason. #Some of them may be deleted but others are there to make sure the drives will be mounted #properly #---Settings---# # Splash screens (if available) NFS_SPLASH="/etc/intimate/pics/IntimateSplashNFS.pnm" HDD_SPLASH="/etc/intimate/pics/IntimateSplashudrive.pnm" SPLASHER="/bin/pnmtofb" # Modules needed before cardmgr is run GENERIC_MODULES="h3600_generic_sleeve pcmcia_core ds h3600_ts" #IDE_CS_MODULES="" # not needed? # Where intimate lives, if it is on microdrive. (For nfsroot leave this as /dev/hda1) ROOTDEV="/dev/hda1" ROOTFS="auto" # Mono ipaqs will like this - swapon early, swapon often. ;) #SWAPDEV="" # Not needed for boot, most times # Some of us (ok, maybe just me) have to suspend before wvlan works. This prompts and pauses 5s. SUSPEND_PAUSE="N" # SUBROUTINES runfor() { limit=$1; shift echo RUNFOR ( $* #$* > /tmp/.limit.$$.out 2> /tmp/.limit.$$.err echo $? > /tmp/.limit.$$.res ) & sub=$! count=0 while [ $count -lt $limit ]; do sleep 1 count=$(($count+1)) [ -s /tmp/.limit.$$.res ] && count=$limit echo -n . done if [ -f /tmp/.limit.$$.res ]; then result=`cat /tmp/.limit.$$.res` else echo TIMEOUT echo TIMEOUT > /dev/vc/0 result=-1 kill $sub > /dev/null 2>&1 fi exit $result } getkey() { dd if=/dev/touchscreen/key bs=1 count=2 2>/dev/null | \ /usr/bin/tr \\001-\\017 A-X|/usr/bin/tr \\201-\\230 a-x } pm_setup() { mount /flash 2> /dev/null echo /flash/sbin/pm_helper_i > /proc/sys/pm/helper echo /flash/sbin/hotplug_i > /proc/sys/kernel/hotplug } PATH=/bin:/sbin export GENERIC_MODULES IDE_CS_MODULES ROOTDEV ROOTFS SWAPDEV SYSPEND_PAUSE PATH ###END DEFAULTS### #stuff actually begins here...please ignore the subroutines above #they aren't used...sooner or later i'll clean them up. if [ -f /.intimateboot ]; then . /.intimateboot fi echo "Mounting /proc" #echo "Mounting /proc" > /dev/vc/0 mount -n /proc mount /mnt/ramfs mkdir /mnt/ramfs/tmp chmod +t /mnt/ramfs/tmp mkdir -p /mnt/ramfs/var/log/ksymoops mkdir /mnt/ramfs/var/run mkdir -p /mnt/ramfs/var/lib/pcmcia touch /var/run/pcmcia-scheme #KERNEL_VERSION=`uname -r` depmod -a if [ ".$GENERIC_MODULES" != "." ]; then for i in $GENERIC_MODULES; do modprobe $i done fi if [ ".$IDE_CS_MODULES" != "." ]; then for i in $IDE_CS_MODULES; do modprobe $i done fi if [ ".$SUSPEND_PAUSE" = ".Y" ]; then echo "Last chance to suspend and fix pcmcia..." echo "Last chance to suspend and fix pcmcia..." > /dev/vc/0 sleep 5 fi #original chooser routines --Does not work with Fam v6 or some combination of what i have #until [ "$action" != "" ]; do # echo -- "-----------------------------------------------" # echo "----------------------------------------" > /dev/vc/0 # echo "What would you like to do?" # echo "What would you like to do?" > /dev/vc/0 # echo "CAL = INTIMATE (normal)" # echo "CAL = INTIMATE (normal)" > /dev/vc/0 # echo "TEL = FAMILIAR" # echo "TEL = FAMILIAR" > /dev/vc/0 # echo " Q = INTIMATE using the BIND method" # echo " Q = INTIMATE using the BIND method" > /dev/vc/0 # echo "--> = REBOOT" # echo "--> = REBOOT" > /dev/vc/0 # [ "$key" = "Bb" ] && action="intimate" # [ "$key" = "Cc" ] && action="familiar" # [ "$key" = "Dd" ] && { action="intimate"; bind="yes"; } # [ "$key" = "Ee" ] && action="reboot" # [ "$key" = "Jj" ] && exec /bin/sh # [ "$key" = "Ff" ] && { action="intimate"; bind="ram"; } # [ "$action" = "intimate" -o "$action" = "intimatebind" ] && { echo "cardmgr" /dev/vc/0 cardmgr -q -o -c /etc/pcmcia sleep 2 if [ ! -b $ROOTDEV ]; then echo; echo "Can\'t find $ROOTDEV" echo "Can\'t find $ROOTDEV" > /dev/vc/0 echo "You could try re-seating the sleeve or the card/drive" echo "You could try re-seating the sleeve or the card/drive" /dev/vc/0 action="" fi # } action=intimate #done echo echo $action echo $action > /dev/vc/0 echo echo This bootscript version made by NSCo > /dev/vc/0 echo echo [ "$action" = "reboot" ] && exec /sbin/reboot #if [ "$action" = "intimate" -a -b $ROOTDEV ] #then #Loading needed drivers. echo Loading needed drivers > /dev/vc/0 modprobe apm modprobe h3600_ts modprobe sa1100-rtc modprobe h3600-sleeve modprobe h3600_generic_sleeve modprobe h3600-uda1341 modprobe ds echo Modprobing complete > /dev/vc/0 echo Done Loading Drivers, sleeping 7 > /dev/vc/0 sleep 2 depmod sleep 5 echo Doing Cardmgr, starting your cards > /dev/vc/0 cardmgr -q -d -m /lib/modules/2.4.18-rmk3/pcmcia/ sleep 5 #GENERIC_MODULES="h3600_generic_sleeve pcmcia_core ds h3600_ts" #insmod -f /lib/modules/2.4.18-rmk3/kernel/fs/ext2/ext2.o # mount -n -t jffs2 /dev/mtdblock/4 /mnt/hda1 echo About to mount > /dev/vc/0 echo About to mount sleep 5 # mount -t ext2 /dev/hda1 /mnt/hda1 # mount -t ext2 /dev/hda1 /mnt/hda1 mkdir /mnt/hda1 sleep 1 cd /dev/ide/host0/bus0/target0/lun0/ ls sleep 4 #change the ext2 to ext3 if you wish to use ext3 instead of 2 mount -o noatime -n -t ext2 /dev/ide/host0/bus0/target0/lun0/part1 /mnt/hda1 echo sleeping 2, drive /dev/hda1 already mounted, hopefully > /dev/vc/0 echo hopefully the drive mounted sleep 2 echo Giving the drives time > /dev/vc/0 echo Giving the drive time sleep 5 echo now attempting to pivot > /dev/vc/0 mount -n -t devfs none /mnt/hda1/dev pivot_root /mnt/hda1 /mnt/hda1/boot sleep 5 echo hopefully pivot_root did it > /dev/vc/0 echo exec sbin > /dev/vc/0 exec /sbin/init || { echo FAILED - REBOOTING; sleep 15; reboot; } #if the drive does not mount echo You're screwed > /dev/vc/0 exit