#!/bin/sh # find out how to run echo to suppress newlines if echo '\c' | grep c >/dev/null then n='-n'; e='-e'; c=''; else n=''; c='\c'; fi ask () { echo $n "$1 (y/n) [$2] $c" if [ "$OPT_y" ]; then response="y" echo $response else read response fi [ ."$response" = "j" ] && response="y" [ -z "$response" ] && response="$2" [ ."$response" = ."y" ] } # find out how to run echo to suppress newlines if echo '\c' | grep c >/dev/null then n='-n'; e='-e'; c=''; else n=''; c='\c'; fi if [ ! -d ./INSTALL.d ] ; then echo This script needs to be run from inside the debroot directory. echo Error: Could not find a ./INSTALL.d directory! exit 0 fi echo Creating the startup script echo " #!/bin/sh #Startup Commands export DISPLAY=0:0 if [ -f "${HOME}/.xmodmaprc" ] ; then xmodmap ~/.xmodmaprc fi swapon /swapfile /usr/bin/icewm-session #Shutdown Commands swapoff /swapfile " > startd chmod 755 startd echo "Creating symlink to home directory" ln -s /root home/root echo "Creating a 64MB swap file" dd if=/dev/zero of=swapfile bs=1024 count=65536 mkswap swapfile echo "Removing INSTALL.d directory." rm -rf INSTALL.d echo "Storing the debroot location" pwd > /etc/debroot echo "Installation is finished," if ask "would you like to delete this setup file?" "y" then rm /opt/QtPalmtop/bin/pocketworkstation-postinst.sh fi echo "Installation is complete."