Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #name this file archarm.init.sh
- ##########################################
- # This file goes in chroot /root dir #
- # This file needs to be executable #
- # chmod 755 archarm.init.sh #
- ##########################################
- #ArchArm init script(archarm.init.sh #
- #by workdowg - based on #
- #Ubuntu init.sh script #
- #Built by Zachary Powell (zacthespack) #
- #Thanks to: #
- #Johan (sciurius) #
- #Marshall Levin #
- #and to everyone at XDA! #
- ##########################################
- # This script has been modified to run #
- # Archlinux on the Acer Iconia A200 by #
- # workdowg (acertabletfurum) #
- # Thanks to all of the above #
- ##########################################
- #############################################
- # Asks User to screen size and saves as REZ #
- #############################################
- echo "Now enter the screen size you want in pixels (e.g. 800x480), followed by [ENTER]:"
- read REZ
- ##############################################
- # Pick which desktop environment to use, this#
- # is done by having a xstartup file for each #
- # desktop, then renaming the one you want to #
- # use to 'xstartup' before boot #
- ##############################################
- echo "Please select which Desktop environment you want to use, type the number to select it then press [ENTER]"
- echo "1 - LXDE"
- echo "2 - XFCE4"
- echo "Make your Selection:"
- read DESKTOP
- if [ $DESKTOP == 1 ]
- then
- mv /root/.vnc/lxstartup /root/.vnc/xstartup
- fi
- if [ $DESKTOP == 2 ]
- then
- mv /root/.vnc/xfce4startup /root/.vnc/xstartup
- fi
- ###########################################
- # Tidy up previous LXDE and DBUS sessions #
- ###########################################
- rm /tmp/.X* > /dev/null 2>&1
- rm /tmp/.X11-unix/X* > /dev/null 2>&1
- rm /root/.vnc/localhost* > /dev/null 2>&1
- rm /var/run/dbus/pid > /dev/null 2>&1
- ############################################################
- # enable workaround for upstart dependent installs #
- # in chroot'd environment. this allows certain packages #
- # that use upstart start/stop to not fail on install. #
- # this means they will have to be launched manually though #
- ############################################################
- dpkg-divert --local --rename --add /sbin/initctl > /dev/null 2>&1
- ln -s /bin/true /sbin/initctl > /dev/null 2>&1
- ###############################################
- # start vnc server with given resolution and #
- # DBUS server, (and optionally an SSH server) #
- ###############################################
- vncserver :0 -geometry $REZ
- dbus-daemon --system --fork > /dev/null 2>&1
- #/etc/rc.d/sshd start
- echo
- echo "If you see the message 'New 'X' Desktop is localhost:0' then you are ready to VNC into your ArchArm OS.."
- echo
- echo "If VNC'ing from a different machine on the same network as the android device use the 1st address below:"
- ##########################################
- # Output IP address of android device #
- ##########################################
- ifconfig | grep "inet addr"
- echo
- echo "If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)"
- echo
- echo "To shut down the VNC server and exit the ArchArm environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!"
- echo
- ###############################################################
- # Spawn and interactive shell - this effectively halts script #
- # execution until the spawning shell is exited (i.e. you want #
- # to shut down vncserver and exit the ArchArm environment) #
- ###############################################################
- /bin/bash -i
- #########################################
- # Disable upstart workaround and #
- # kill VNC server (and optionally SSH) #
- # Rename used xstartup to its first file#
- #########################################
- vncserver -kill :0
- if [ $DESKTOP == 1 ]
- then
- mv /root/.vnc/xstartup /root/.vnc/lxstartup
- fi
- if [ $DESKTOP == 2 ]
- then
- mv /root/.vnc/xstartup /root/.vnc/xfce4startup
- fi
- #/etc/rc.d/sshd stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement