A bash script to install Void Linux with LUKS encryption, optional LVM, btrfs filesystem and optional swap as file.
Go to file
2022-07-18 19:48:26 +02:00
ASCIIArt Upload logo ASCII art 2022-07-14 20:29:06 +02:00
chroot.sh Beautifying cat 2022-07-18 11:02:24 +02:00
LICENSE Upload files 2022-07-05 20:42:36 +02:00
README.md Fix typo 2022-07-18 19:24:40 +02:00
VoidLinuxInstaller.sh Fix musl repo 2022-07-18 19:48:26 +02:00

VoidLinuxInstaller script

The VoidLinuxInstaller script is an attempt to make my gist an interactive bash script.

As stated in the gist, this script provides:

  • Full Disk Encryption (including /boot) with LUKS;
  • Logic Volume Management (LVM);
  • Separated /home partition;
  • BTRFS as filesystem.
  • Trim on SSD;

All of this is accomplished with the following steps:

  1. Changing keyboard layout;
  2. Checking internet connection;
  3. Wiping a user choosen drive;
  4. Partitioning a user choosen drive;
  5. Encrypting a user choosen drive;
  6. Applying LVM;
  7. Formatting partitions to proper filesystems;
  8. Creating BTRFS subvolumes;
  9. Installing base system;
  10. Chrooting.

This script comes from my need to automate my gist as much as I can, and also as a way to learn Bash scripting as well. This is my first Bash script ever created so bugs, errors and really ugly code are expected!

I've tried this script a lot with virtual machines and following every step always brought me to a functional system, so there should be no problem from this point of view!

Pull requests are absolutely welcome!

How to run it

Using wget to download the needed files:

wget https://raw.githubusercontent.com/Le0xFF/VoidLinuxInstaller/main/VoidLinuxInstaller.sh -O $HOME/VoidLinuxInstaller.sh
wget https://raw.githubusercontent.com/Le0xFF/VoidLinuxInstaller/main/chroot.sh -O $HOME/chroot.sh

or curl if you prefer:

curl -o $HOME/VoidLinuxInstaller.sh https://raw.githubusercontent.com/Le0xFF/VoidLinuxInstaller/main/VoidLinuxInstaller.sh
curl -o $HOME/chroot.sh https://raw.githubusercontent.com/Le0xFF/VoidLinuxInstaller/main/chroot.sh

then make them executable:

chmod +x $HOME/*.sh

and finally run it:

bash $HOME/VoidLinuxInstaller.sh

Notes

If you are going to use snapper and snapper-gui, it probably will complain about .snapshots folder already present. To avoid that, please use this reference from the Arch Wiki.

Resources

[1] https://tldp.org/LDP/Bash-Beginners-Guide/html/index.html
[2] https://gist.github.com/tobi-wan-kenobi/bff3af81eac27e210e1dc88ba660596e
[3] https://gist.github.com/gbrlsnchs/9c9dc55cd0beb26e141ee3ea59f26e21
[4] https://unixsheikh.com/tutorials/real-full-disk-encryption-using-grub-on-void-linux-for-bios.html