Advertisement
Guest User

Untitled

a guest
Aug 15th, 2017
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 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 03Aug: 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.  
  14. cat <<EOF
  15. ##############################
  16. START: Chroot install script
  17.  
  18. EOF
  19.  
  20. echo " Password for root: toor"
  21. #passwd root
  22. echo root:toor | chpasswd
  23. # IVN other user than scott
  24. echo " Create accnt raxy:xyra"
  25. echo " Add user to groups: sudo, dialout"
  26. useradd -G sudo,dialout -m -s /bin/bash raxy
  27. #echo " Password for raxy: xyra"
  28. echo raxy:xyra | chpasswd
  29.  
  30. MY_HOSTNAME=ivnVimPro
  31. echo $MY_HOSTNAME > /etc/hostname
  32. echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts
  33. echo "127.0.0.1 $MY_HOSTNAME" >> /etc/hosts
  34.  
  35. echo "nameserver 127.0.1.1" > /etc/resolv.conf
  36. # googles DNS servers which are 8.8.8.8 or 8.8.4.4
  37. echo "nameserver 8.8.8.8" >> /etc/resolv.conf
  38.  
  39. # IVN Serial console
  40. ln -s /lib/systemd/system/serial-getty\@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service
  41.  
  42. echo ""
  43. echo " Fixing locale information"
  44. echo " (Ignore notices during this process, if any)"
  45. for y in $(locale | cut -d '=' -f 2| sort |uniq );do locale-gen $y > /dev/null 2>&1; done
  46. echo " locale shit done."
  47.  
  48. cat <<EOF
  49.  
  50. ################
  51. apt-get update
  52.  
  53. EOF
  54. apt-get update
  55. echo "Install 'dialog' to fix an annoying warning"
  56. echo "Install 'apt-utils' to fix warnings"
  57. echo ""
  58. apt-get -y install dialog apt-utils
  59. cat <<EOF
  60.  
  61. #################
  62. no apt-get upgrade for now
  63.  
  64. EOF
  65. #apt-get -y upgrade
  66. #apt-get -y dist-upgrade
  67. cat <<EOF
  68. ################
  69. apt-get Install Core Packages
  70.  
  71. EOF
  72. #Install the network, graphics (framebuffer) and core basic packages
  73. apt-get -y install sudo curl vim udev initramfs-tools fbset
  74. apt-get -y install ifupdown net-tools network-manager wireless-tools
  75. ##Install basic package preferences
  76. # IVN no cifs
  77. apt-get -y install nano htop openssh-server screen putty iputils-ping
  78.  
  79. #Add these for the whole Mate GUI
  80. #If you are going to do this - increase the rootfs image size in Script/Stage 4 first!
  81. cat <<EOF
  82. ################
  83. NO apt-get Installing Mate GUI!
  84.  
  85. EOF
  86. # These bastards want to ask about your keyboard - but I dont want to answer
  87. # so I'm explicitly telling them non-interactive.
  88.  
  89. # IVN no mate, no xorg, armhf!
  90. #DEBIAN_FRONTEND=noninteractive apt-get -y install xorg xauth
  91. #apt-get -y install ubuntu-mate-core mate-desktop-environment mate-notification-daemon
  92. #apt-get -y install gnome-mplayer bluetooth
  93.  
  94. apt-get autoremove
  95. apt-get clean
  96. # So I set this device up as a programming unit on my electronic workbench
  97. # This means a bunch of IDEs etc. For example Arduino IDE, which is not aarch64 yet.
  98. # So all this below enables armhf packages, then installs some armhf packages that I need..
  99. #
  100. #armhf arch enable
  101. #dpkg --add-architecture armhf
  102. #sudo apt-get update
  103.  
  104. # IVN no java,gtk!
  105.  
  106. #64bit Java:
  107. #sudo apt-get -y install openjdk-8-jre
  108. #32bit Java:
  109. #sudo apt-get -y install openjdk-8-jre:armhf
  110. ## Default will be arm64, but later I will need to change my preferred package using:
  111. ## "sudo update-alternatives --config java" and pick the 32 bit (armhf) version.
  112.  
  113. #64bit GTK2 engine:
  114. #apt-get -y install gtk2-engines-murrine gtk2-engines-pixbuf murrine-themes
  115. #32bit GTK2 engine:
  116. #apt-get -y install gtk2-engines-murrine:armhf gtk2-engines-pixbuf:armhf
  117.  
  118. # Load WIFI at boot time
  119. echo dhd >> /etc/modules
  120. # Enable 'khadas' Bluetooth
  121. systemctl enable bluetooth-khadas
  122.  
  123. #Sort out some basic networking info for eth0
  124. echo "Setting up eth0"
  125. cp -a /etc/network/interfaces /etc/network/interfaces.orig
  126. # comment below else takes toot long to boot
  127. #echo "auto eth0" >> /etc/network/interfaces
  128. echo "allow-hotplug eth0" >> /etc/network/interfaces
  129. echo "iface eth0 inet dhcp" >> /etc/network/interfaces
  130. # IVN shorter timeout for ethernet
  131. sed -i "s/TimeoutStartSec=5min/TimeoutStartSec=30sec/g" /etc/systemd/system/network-online.target.wants/networking.service
  132.  
  133. # IVN crda update for wifi
  134. sed -i "s/REGDOMAIN=/REGDOMAIN=FR/g" /etc/default/crda
  135.  
  136. #Restore the sources.list from mirrors to original
  137. if [ -f /etc/apt/sources.list.orig ]; then
  138. mv /etc/apt/sources.list.orig /etc/apt/sources.list
  139. fi
  140. # IVN below does not work
  141. #echo "IVN prep intl kdb, relevant only for hardware kbd over usb"
  142. #export DEBIAN_FRONTEND=noninteractive
  143. #apt-get -yq install keyboard-configuration
  144.  
  145. echo "#### Clean up"
  146. apt-get autoremove
  147. apt-get clean
  148.  
  149. cat <<EOF
  150.  
  151. END: Chroot install script
  152. ############################
  153.  
  154. EOF
  155.  
  156. # Delete Me
  157. rm $0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement