Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #This program is free software: you can redistribute it and/or modify
- #it under the terms of the GNU General Public License as published by
- #the Free Software Foundation, either version 3 of the License, or
- #(at your option) any later version.
- #This program is distributed in the hope that it will be useful,
- #but WITHOUT ANY WARRANTY; without even the implied warranty of
- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- #GNU General Public License for more details.
- #You should have received a copy of the GNU General Public License
- #along with this program. If not, see <http://www.gnu.org/licenses/>.
- #######################################################################
- echo "Some note taking is required towards the end of this application,
- please ensure you have a pen and paper etc"
- #######################################################################
- #Installing the dependencies [Required]
- echo "Installing Dependencies"
- pacman -S archiso make squashfs-tools libisoburn dosfstools patch lynx devtools git
- #makes directory for archiso [Required]
- mkdir ~/archlive
- #######################################################################
- #Adding packages to packages.both [optional]
- #You can make a very simple arch linux system with the bare amount of
- #packages installed. Such as:
- #xorg-server
- #xorg-xinit
- #xorg-server-utils
- #xf86-video-vesa
- #(login-manager of choice)
- #(Desktop Environment of choice)
- #firefox ..etc etc
- #######################################################################
- #If you want every single package installed on the current system onto
- #the new system uncomment the pacman -Qqe >> ~/archlive/packages.both
- #[Note] Ensure you have enough space for every package to be installed
- #the new system
- #pacman -Qqe >> ~/archlive/packages.both #Optional
- #Alternatively you can list all packages installed with the:
- #pacman -Qqe
- #command and then add the packages to the packages.both file manually
- #######################################################################
- #Checks for slim and copies config file
- if -f [ /etc/slim.conf ]; then
- echo "Copying /etc/slim.conf"
- sleep 2
- cp /etc/slim.conf ~/archlive/airootfs/etc/
- fi
- #######################################################################
- #Uncomment to let custom distro have same users as host machine
- #cp /etc/{shadow,passwd,group} ~/archlive/airootfs/etc/
- #######################################################################
- #Uncomment to create skel [Required for making backup ISO's]
- #mkdir ~/archlive/airootfs/etc/skel
- #cp ~/.bashrc ~/archlive/airootfs/etc/skel/
- #cp ~/.xinitrc ~/archlive/airootfs/etc/skel/
- #cp ~/.config ~/archlive/airootfs/etc/skel/
- #######################################################################
- echo "To log in automatically as your user instead of the default root user, open the
- ~/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:
- ExecStart=-/sbin/agetty --autologin arch --noclear %I 38400 linux
- Replace arch with the name of your user...Have you read this? y/n"
- select yn in "Yes" "No"; do
- case $yn in
- Yes ) break;;
- No ) exit;;
- esac
- done
- #######################################################################
- echo "Almost done!"
- sleep 2
- #######################################################################
- #Final configurations have to be done manually
- echo "Final configurations"
- sleep 1
- echo "Inside root’s home folder (~/archlive/airootfs/root) there’s a
- file named customize-root-image.sh."
- sleep 1
- echo "Any administrative task that you would normally do after an Arch
- install can be scripted into this file.
- Remember that the instructions within the file have to be written from the
- perspective of the new environment, which is to say that / in the
- script represents the root of the distro that’s being assembled."
- sleep 3
- while true; do
- read -p "Have you read this" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
- done
- echo "We're going to open the customize-root-image.sh in a text editor"
- sleep 2
- echo "You need to do some things manually"
- sleep 2
- echo "Make sure the timezone is correct"
- sleep 2
- echo "Set the shell to bash, not zsh"
- sleep 2
- echo "Then copy the contents of skel to your home directory: Example"
- sleep 2
- "cp -aT /etc/skel/ /home/arch/"
- sleep 2
- echo "remember to change arch to name of your user account"
- sleep 2
- echo "And to set proper ownership with:"
- sleep 2
- echo "chown bodhi:users /home/arch -R"
- sleep 2
- echo "Remember to change arch to your user account again"
- sleep 2
- echo "Finally, scroll down to the end of the file and comment out all
- the systemctl commands by appending a # symbol before them.
- To boot into the graphical desktop, make sure the correct services
- are started at boot by adding the following:
- systemctl enable pacman-init.service choose-mirror.service
- systemctl set-default graphical.target
- systemctl enable graphical.target"
- sleep 10
- #######################################################################
- echo "That’s it. You’re now all set tobuild the ISO for your custom distro.
- Enter the ~/archlive directory
- and run:
- ./build.sh
- This initiates the build process. The -v switch enables the
- verbose mode, the -N switch sets the name of the ISO image, -V sets the
- version number and -L appends a label to the generated ISO image.
- Note that the build process is slow and can take several hours depending
- on the available resources of your computer.
- When it’s done it’ll place the ISO under the
- ~/archlive/out directory."
- sleep 10
- cd ~/archlive
- #######################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement