Scripts to setup a minimal Debian Linux system.
First, create 4 partitions:
- 1GB EFI partition
- 1GB boot partition
- 20GB root partition # (Atleast) Can make however large you need
- home partition with the remaining disk space
- OR multiple partitions when using RAID
sudo -i # become root now for running later commands
cfdisk /dev/diskSecond, create a partition on your USB stick (should be atleast 10MB) if you'll be using a USB for LUKS encryption
Third, ensure you are connected to Ethernet or WiFi. Then clone the repository
and run start_install.sh:
apt update
apt install -y git nano
git clone https://www.github.com/JustScott/DebianInstaller
nano ./DebianInstaller/install_constants # Populate the relevant variables
bash ./DebianInstaller/start_install.sh # run as rootZERO prompts, all information needed for installation should be populated by
the user in install_constants before running the script
A start_install_completion.txt file is created as the script is
ran so that if any command in the script fails, you can resolve
the issue and run bash ./DebianInstaller/start_install.sh again for it
to start after the last successfully ran command.
- If you want to restart the script, just delete the completion file
- If you want to start from a specific command/position in the script, you can just delete up to and including that command
- Or you can even just delete a specific command to just rerun that command
There is also a finish_install_completion.txt file located at /mnt/
that tracks the completion of finish_install.sh. All the rules above
regarding start_install apply the same.
- Realtek, iwlwifi, or mediatek wifi driver will be installed (if wifi enabled
in
install_constants) - AMD or Intel GPU driver will be installed (if a desktop environment is chosen)
- The code for nvidia drivers is there but commented out as I have no way of testing it
- AMD or Intel CPU microcode will be installed
Reinstalling without overwriting your home partition is as easy as setting a
single variable in the install_constants file. During reinstallation you can
also add a new LUKS encryption method assuming you provide at least one correct
one... for example you can add a new passphrase if you have an existing keyfile
or vice versa. This can also be helpful if you already had both methods set during
your initial installation, but you lost your USB stick with the keyfile or you
forgot your passphrase. As long as you have one you can always add another.
You can run bash ./DebianInstaller/safely_close_system.sh after the
installation scripts are done running to automatically remove sensitive
files and safely unmount all the partitions. Then just run shutdown now
or reboot.
run_integration_tests.sh is full of tests that will run the installer
over and over (only installing packages on the first run) with different
configurations and will only fail if any step of the installer fails.
- To make testing easy, just create all the partitions on one disk
- /dev/vda1 - 1GB EFI
- /dev/vda2 - 1GB Boot
- /dev/vda3 - 15GB Root
- /dev/vda4 - 10GB Home
- /dev/vda5 - 10GB Home (for RAID 1 tests)
- /dev/vda6 - 512MB Keyfile
- Ensure those match the
integration_tests_global_partition_variablesfile before continuing
- You should not edit the
install_constantsfile at all during testing, only edit theintegration_tests_global_partition_variablesfile with the correct disk and partitions. - A completion file will be created to ensure rerunning the script will not rerun tests that have already passed, so delete entries in there to rerun any test. These tests are meant to be run in order, one running successfully will verify that the one before it also ran successfully.
- Now just run
run_integration_tests.sh