Skip to content

Repository files navigation

DebianInstaller

Scripts to setup a minimal Debian Linux system.

Usage

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/disk

Second, 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 root

Script Features

ZERO prompts, all information needed for installation should be populated by the user in install_constants before running the script

Script Completion Handling

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.

Automatic driver installation

  • 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

Reinstallation without overwriting the home partition

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.

Post Installation Cleanup

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.

Testing

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.

Partition Setup

  • 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_variables file before continuing

Usage

  • You should not edit the install_constants file at all during testing, only edit the integration_tests_global_partition_variables file 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

About

A declarative Debian Linux installer that configures a Debian system from a single configuration file.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages