Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.73 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #### my name is 99.ChrootScript.sh and I was originally Written By Stifler6996 (Tang73)
  4. ##
  5. ## This script should be executed inside chroot jail only!!!
  6. ## It will be copied over in (0x07) of 1.2.3.Run.sh and it
  7. ## will then be executed in (0x08) if you select {a}utorun.
  8. ##
  9. # mod by IVN on 17Aug: no mate, no dev stuff, add keyboard-configuration, user raxy, serial console, no upgrade
  10. # use MY_HOSTNAME, inst iputils-ping DEBIAN-FRONTEND yq, remove some comments, shorter timeout for ethernet, add crda FR
  11. # remove 0x63
  12. # knownbugs : fail to start bluetooth err in dmesg, replace echo with cat <<EOF, remove all -e
  13. # comment all bluetooth as does not boot, see below...
  14. if [ 0 -eq 1 ]; then
  15. # run these as root only on the kvim once it is booted up !
  16. echo "hci_uart" >> /etc/modules
  17. cd /usr/local/bin
  18. vi khadas-bt-init (fill it with the khadas-bt-init on your PC or w/ https://pastebin.com/mKBr3UCr)
  19. chmod +x khadas-bt-init
  20. update-rc.d khadas-bt-init defaults
  21. wget http://download1339.mediafireuserdownload.com/1pbaw901nrng/18v8miyhefi7vm8/brcm_patchram_plus
  22. chmod +x brcm_patchram_plus
  23. vi /etc/apt/sources.list
  24. uncommment deb http://archive.canonical.com/ubuntu xenial partner
  25. apt-get update
  26. apt-get install -y bluetooth blueman bluez bluez-tools libbluetooth-dev
  27. sync; reboot
  28. lsmod | grep hci_uart
  29. # .. and just let /usr/local/bin/khadas-bt-init" do its thing in each session (and not rc.local !!)
  30. # need to take into accnt what /etc/init.d/bluetooth already does ??
  31. fi
  32.  
  33. cat <<EOF
  34. ##############################
  35. START: Chroot install script
  36.  
  37. EOF
  38.  
  39. echo " Password for root: toor"
  40. #passwd root
  41. echo root:toor | chpasswd
  42. # IVN other user than scott
  43. echo " Create accnt raxy:xyra"
  44. echo " Add user to groups: sudo, dialout"
  45. useradd -G sudo,dialout -m -s /bin/bash raxy
  46. #echo " Password for raxy: xyra"
  47. echo raxy:xyra | chpasswd
  48.  
  49. MY_HOSTNAME=ivnVimPro
  50. echo $MY_HOSTNAME > /etc/hostname
  51. echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts
  52. echo "127.0.0.1 $MY_HOSTNAME" >> /etc/hosts
  53.  
  54. echo "nameserver 127.0.1.1" > /etc/resolv.conf
  55. # googles DNS servers which are 8.8.8.8 or 8.8.4.4
  56. echo "nameserver 8.8.8.8" >> /etc/resolv.conf
  57.  
  58. # IVN Serial console
  59. ln -s /lib/systemd/system/serial-getty\@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service
  60.  
  61. echo ""
  62. echo " Fixing locale information"
  63. echo " (Ignore notices during this process, if any)"
  64. for y in $(locale | cut -d '=' -f 2| sort |uniq );do locale-gen $y > /dev/null 2>&1; done
  65. echo " locale shit done."
  66.  
  67. cat <<EOF
  68.  
  69. ################
  70. apt-get update
  71.  
  72. EOF
  73. apt-get update
  74. echo "Install 'dialog' to fix an annoying warning"
  75. echo "Install 'apt-utils' to fix warnings"
  76. echo ""
  77. apt-get -y install dialog apt-utils
  78. cat <<EOF
  79.  
  80. #################
  81. no apt-get upgrade for now
  82.  
  83. EOF
  84. #apt-get -y upgrade
  85. #apt-get -y dist-upgrade
  86. cat <<EOF
  87. ################
  88. apt-get Install Core Packages
  89.  
  90. EOF
  91. #Install the network, graphics (framebuffer) and core basic packages
  92. apt-get -y install sudo curl vim udev initramfs-tools fbset
  93. apt-get -y install ifupdown net-tools network-manager wireless-tools
  94. ##Install basic package preferences
  95. # IVN no cifs
  96. apt-get -y install nano htop openssh-server screen putty iputils-ping rfkill
  97.  
  98.  
  99. #Add these for the whole Mate GUI
  100. #If you are going to do this - increase the rootfs image size in Script/Stage 4 first!
  101. cat <<EOF
  102. ################
  103. NO apt-get Installing Mate GUI!
  104.  
  105. EOF
  106.  
  107.  
  108. # These bastards want to ask about your keyboard - but I dont want to answer
  109. # so I'm explicitly telling them non-interactive.
  110.  
  111. # IVN no mate, no xorg, armhf!
  112. #DEBIAN_FRONTEND=noninteractive apt-get -y install xorg xauth
  113. #apt-get -y install ubuntu-mate-core mate-desktop-environment mate-notification-daemon
  114. #apt-get -y install gnome-mplayer
  115.  
  116. apt-get autoremove
  117. apt-get clean
  118. # So I set this device up as a programming unit on my electronic workbench
  119. # This means a bunch of IDEs etc. For example Arduino IDE, which is not aarch64 yet.
  120. # So all this below enables armhf packages, then installs some armhf packages that I need..
  121. #
  122. #armhf arch enable
  123. #dpkg --add-architecture armhf
  124. #sudo apt-get update
  125.  
  126. # IVN no java,gtk!
  127.  
  128. #64bit Java:
  129. #sudo apt-get -y install openjdk-8-jre
  130. #32bit Java:
  131. #sudo apt-get -y install openjdk-8-jre:armhf
  132. ## Default will be arm64, but later I will need to change my preferred package using:
  133. ## "sudo update-alternatives --config java" and pick the 32 bit (armhf) version.
  134.  
  135. #64bit GTK2 engine:
  136. #apt-get -y install gtk2-engines-murrine gtk2-engines-pixbuf murrine-themes
  137. #32bit GTK2 engine:
  138. #apt-get -y install gtk2-engines-murrine:armhf gtk2-engines-pixbuf:armhf
  139.  
  140. # Load WIFI at boot time
  141. echo dhd >> /etc/modules
  142.  
  143. #Sort out some basic networking info for eth0
  144. echo "Setting up eth0"
  145. cp -a /etc/network/interfaces /etc/network/interfaces.orig
  146. # comment below else takes toot long to boot
  147. #echo "auto eth0" >> /etc/network/interfaces
  148. echo "allow-hotplug eth0" >> /etc/network/interfaces
  149. echo "iface eth0 inet dhcp" >> /etc/network/interfaces
  150. # IVN shorter timeout for ethernet
  151. sed -i "s/TimeoutStartSec=5min/TimeoutStartSec=30sec/g" /etc/systemd/system/network-online.target.wants/networking.service
  152.  
  153. # IVN crda update for wifi
  154. sed -i "s/REGDOMAIN=/REGDOMAIN=FR/g" /etc/default/crda
  155.  
  156. #Restore the sources.list from mirrors to original
  157. if [ -f /etc/apt/sources.list.orig ]; then
  158. mv /etc/apt/sources.list.orig /etc/apt/sources.list
  159. fi
  160. # IVN below does not work
  161. #echo "IVN prep intl kdb, relevant only for hardware kbd over usb"
  162. #export DEBIAN_FRONTEND=noninteractive
  163. #apt-get -yq install keyboard-configuration
  164.  
  165. echo "#### Clean up"
  166. apt-get autoremove
  167. apt-get clean
  168.  
  169. cat <<EOF
  170.  
  171. END: Chroot install script
  172. ############################
  173.  
  174. EOF
  175.  
  176. # Delete Me
  177. rm $0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement