Advertisement
MorpheusArch

Archiso Configuration Script

Mar 17th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.83 KB | None | 0 0
  1. #!/bin/bash
  2. #This program is free software: you can redistribute it and/or modify
  3. #it under the terms of the GNU General Public License as published by
  4. #the Free Software Foundation, either version 3 of the License, or
  5. #(at your option) any later version.
  6.  
  7. #This program is distributed in the hope that it will be useful,
  8. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10. #GNU General Public License for more details.
  11.  
  12. #You should have received a copy of the GNU General Public License
  13. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14.  
  15. #######################################################################
  16.  
  17. echo "Some note taking is required towards the end of this application,
  18. please ensure you have a pen and paper etc"
  19.  
  20. #######################################################################
  21.  
  22. #Installing the dependencies [Required]
  23.  
  24. echo "Installing Dependencies"
  25.  
  26. pacman -S archiso make squashfs-tools libisoburn dosfstools patch lynx devtools git
  27.  
  28. #makes directory for archiso [Required]
  29.  
  30. mkdir ~/archlive
  31.  
  32.  
  33. #######################################################################
  34. #Adding packages to packages.both [optional]
  35. #You can make a very simple arch linux system with the bare amount of
  36. #packages installed. Such as:
  37.  
  38. #xorg-server
  39. #xorg-xinit
  40. #xorg-server-utils
  41. #xf86-video-vesa
  42. #(login-manager of choice)
  43. #(Desktop Environment of choice)
  44. #firefox ..etc etc
  45. #######################################################################
  46.  
  47. #If you want every single package installed on the current system onto
  48. #the new system uncomment the pacman -Qqe >> ~/archlive/packages.both
  49. #[Note] Ensure you have enough space for every package to be installed
  50. #the new system
  51.  
  52. #pacman -Qqe >> ~/archlive/packages.both    #Optional
  53.  
  54. #Alternatively you can list all packages installed with the:
  55.  
  56. #pacman -Qqe
  57.  
  58. #command and then add the packages to the packages.both file manually
  59.  
  60. #######################################################################
  61.  
  62. #Checks for slim and copies config file
  63.  
  64. if -f [ /etc/slim.conf ]; then
  65.     echo "Copying /etc/slim.conf"
  66.     sleep 2
  67.     cp /etc/slim.conf ~/archlive/airootfs/etc/
  68. fi
  69.  
  70. #######################################################################
  71.  
  72. #Uncomment to let custom distro have same users as host machine
  73.  
  74. #cp /etc/{shadow,passwd,group} ~/archlive/airootfs/etc/
  75.  
  76. #######################################################################
  77.  
  78. #Uncomment to create skel [Required for making backup ISO's]
  79.  
  80. #mkdir ~/archlive/airootfs/etc/skel
  81. #cp ~/.bashrc ~/archlive/airootfs/etc/skel/
  82. #cp ~/.xinitrc ~/archlive/airootfs/etc/skel/
  83. #cp ~/.config ~/archlive/airootfs/etc/skel/
  84.  
  85. #######################################################################
  86.  
  87. echo "To log in automatically as your user instead of the default root user, open the
  88.  
  89. ~/archlive/airootfs/etc/systemd/system/[email protected]/autologin.conf file in a text editor and modify the following line to swap the auto login user:
  90.  
  91. ExecStart=-/sbin/agetty --autologin arch --noclear %I 38400 linux
  92.  
  93. Replace arch with the name of your user...Have you read this? y/n"
  94.  
  95. select yn in "Yes" "No"; do
  96.     case $yn in
  97.         Yes ) break;;
  98.         No ) exit;;
  99.     esac
  100. done
  101.  
  102. #######################################################################
  103.  
  104. echo "Almost done!"
  105. sleep 2
  106.  
  107. #######################################################################
  108.  
  109. #Final configurations have to be done manually
  110.  
  111. echo "Final configurations"
  112. sleep 1
  113. echo "Inside root’s home folder (~/archlive/airootfs/root) there’s a
  114. file named customize-root-image.sh."
  115. sleep 1
  116. echo "Any administrative task that you would normally do after an Arch
  117. install can be scripted into this file.
  118. Remember that the instructions within the file have to be written from the
  119. perspective of the new environment, which is to say that / in the
  120. script represents the root of the distro that’s being assembled."
  121. sleep 3
  122. while true; do
  123.     read -p "Have you read this" yn
  124.     case $yn in
  125.         [Yy]* ) break;;
  126.         [Nn]* ) exit;;
  127.         * ) echo "Please answer yes or no.";;
  128.     esac
  129. done
  130.  
  131. echo "We're going to open the customize-root-image.sh in a text editor"
  132. sleep 2
  133. echo "You need to do some things manually"
  134. sleep 2
  135. echo "Make sure the timezone is correct"
  136. sleep 2
  137. echo "Set the shell to bash, not zsh"
  138. sleep 2
  139. echo "Then copy the contents of skel to your home directory: Example"
  140. sleep 2
  141. "cp -aT /etc/skel/ /home/arch/"
  142. sleep 2
  143. echo "remember to change arch to name of your user account"
  144. sleep 2
  145. echo "And to set proper ownership with:"
  146. sleep 2
  147. echo "chown bodhi:users /home/arch -R"
  148. sleep 2
  149. echo "Remember to change arch to your user account again"
  150. sleep 2
  151. echo "Finally, scroll down to the end of the file and comment out all
  152. the systemctl commands by appending a # symbol before them.
  153. To boot into the graphical desktop, make sure the correct services
  154. are started at boot by adding the following:
  155. systemctl enable pacman-init.service choose-mirror.service
  156. systemctl set-default graphical.target
  157. systemctl enable graphical.target"
  158. sleep 10
  159. #######################################################################
  160.  
  161. echo "That’s it. You’re now all set tobuild the ISO for your custom distro.
  162.  
  163. Enter the ~/archlive directory
  164. and run:
  165.  
  166. ./build.sh
  167.  
  168. This initiates the build process. The -v switch enables the
  169. verbose mode, the -N switch sets the name of the ISO image, -V sets the
  170. version number and -L appends a label to the generated ISO image.
  171.  
  172. Note that the build process is slow and can take several hours depending
  173. on the available resources of your computer.
  174. When it’s done it’ll place the ISO under the
  175.  
  176. ~/archlive/out directory."
  177.  
  178. sleep 10
  179.  
  180. cd ~/archlive
  181. #######################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement