Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #### my name is 99.ChrootScript.sh and I was originally Written By Stifler6996 (Tang73)
- ##
- ## This script should be executed inside chroot jail only!!!
- ## It will be copied over in (0x07) of 1.2.3.Run.sh and it
- ## will then be executed in (0x08) if you select {a}utorun.
- ##
- # mod by IVN on 03Aug: no mate, no dev stuff, add keyboard-configuration, user raxy, serial console, no upgrade
- # use MY_HOSTNAME, inst iputils-ping DEBIAN-FRONTEND yq, remove some comments, shorter timeout for ethernet, add crda FR
- # remove 0x63
- # knownbugs : fail to start bluetooth err in dmesg, replace echo with cat <<EOF, remove all -e
- cat <<EOF
- ##############################
- START: Chroot install script
- EOF
- echo " Password for root: toor"
- #passwd root
- echo root:toor | chpasswd
- # IVN other user than scott
- echo " Create accnt raxy:xyra"
- echo " Add user to groups: sudo, dialout"
- useradd -G sudo,dialout -m -s /bin/bash raxy
- #echo " Password for raxy: xyra"
- echo raxy:xyra | chpasswd
- MY_HOSTNAME=ivnVimPro
- echo $MY_HOSTNAME > /etc/hostname
- echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts
- echo "127.0.0.1 $MY_HOSTNAME" >> /etc/hosts
- echo "nameserver 127.0.1.1" > /etc/resolv.conf
- # googles DNS servers which are 8.8.8.8 or 8.8.4.4
- echo "nameserver 8.8.8.8" >> /etc/resolv.conf
- # IVN Serial console
- ln -s /lib/systemd/system/serial-getty\@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service
- echo ""
- echo " Fixing locale information"
- echo " (Ignore notices during this process, if any)"
- for y in $(locale | cut -d '=' -f 2| sort |uniq );do locale-gen $y > /dev/null 2>&1; done
- echo " locale shit done."
- cat <<EOF
- ################
- apt-get update
- EOF
- apt-get update
- echo "Install 'dialog' to fix an annoying warning"
- echo "Install 'apt-utils' to fix warnings"
- echo ""
- apt-get -y install dialog apt-utils
- cat <<EOF
- #################
- no apt-get upgrade for now
- EOF
- #apt-get -y upgrade
- #apt-get -y dist-upgrade
- cat <<EOF
- ################
- apt-get Install Core Packages
- EOF
- #Install the network, graphics (framebuffer) and core basic packages
- apt-get -y install sudo curl vim udev initramfs-tools fbset
- apt-get -y install ifupdown net-tools network-manager wireless-tools
- ##Install basic package preferences
- # IVN no cifs
- apt-get -y install nano htop openssh-server screen putty iputils-ping
- #Add these for the whole Mate GUI
- #If you are going to do this - increase the rootfs image size in Script/Stage 4 first!
- cat <<EOF
- ################
- NO apt-get Installing Mate GUI!
- EOF
- # These bastards want to ask about your keyboard - but I dont want to answer
- # so I'm explicitly telling them non-interactive.
- # IVN no mate, no xorg, armhf!
- #DEBIAN_FRONTEND=noninteractive apt-get -y install xorg xauth
- #apt-get -y install ubuntu-mate-core mate-desktop-environment mate-notification-daemon
- #apt-get -y install gnome-mplayer bluetooth
- apt-get autoremove
- apt-get clean
- # So I set this device up as a programming unit on my electronic workbench
- # This means a bunch of IDEs etc. For example Arduino IDE, which is not aarch64 yet.
- # So all this below enables armhf packages, then installs some armhf packages that I need..
- #
- #armhf arch enable
- #dpkg --add-architecture armhf
- #sudo apt-get update
- # IVN no java,gtk!
- #64bit Java:
- #sudo apt-get -y install openjdk-8-jre
- #32bit Java:
- #sudo apt-get -y install openjdk-8-jre:armhf
- ## Default will be arm64, but later I will need to change my preferred package using:
- ## "sudo update-alternatives --config java" and pick the 32 bit (armhf) version.
- #64bit GTK2 engine:
- #apt-get -y install gtk2-engines-murrine gtk2-engines-pixbuf murrine-themes
- #32bit GTK2 engine:
- #apt-get -y install gtk2-engines-murrine:armhf gtk2-engines-pixbuf:armhf
- # Load WIFI at boot time
- echo dhd >> /etc/modules
- # Enable 'khadas' Bluetooth
- systemctl enable bluetooth-khadas
- #Sort out some basic networking info for eth0
- echo "Setting up eth0"
- cp -a /etc/network/interfaces /etc/network/interfaces.orig
- # comment below else takes toot long to boot
- #echo "auto eth0" >> /etc/network/interfaces
- echo "allow-hotplug eth0" >> /etc/network/interfaces
- echo "iface eth0 inet dhcp" >> /etc/network/interfaces
- # IVN shorter timeout for ethernet
- sed -i "s/TimeoutStartSec=5min/TimeoutStartSec=30sec/g" /etc/systemd/system/network-online.target.wants/networking.service
- # IVN crda update for wifi
- sed -i "s/REGDOMAIN=/REGDOMAIN=FR/g" /etc/default/crda
- #Restore the sources.list from mirrors to original
- if [ -f /etc/apt/sources.list.orig ]; then
- mv /etc/apt/sources.list.orig /etc/apt/sources.list
- fi
- # IVN below does not work
- #echo "IVN prep intl kdb, relevant only for hardware kbd over usb"
- #export DEBIAN_FRONTEND=noninteractive
- #apt-get -yq install keyboard-configuration
- echo "#### Clean up"
- apt-get autoremove
- apt-get clean
- cat <<EOF
- END: Chroot install script
- ############################
- EOF
- # Delete Me
- rm $0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement