Sanarch is a simple script written in python to install arch linux from a configuration file. This makes it easier to re-install the system whenever the system breaks. The configurations for the system are specified in a yaml file. This project allows you to:
- Install the base system from a given configuration file.
- Further setup the system after the installation using a custom script.
- Custom script can be written in any scripting language.
- Script can be resumed after correcting any errors during the installation.
- Supports installation with windows dual boot.
python -m sanarch
when inside the root directory of the project or sanarch
when in virtual enviroment can be used to invoke the script.
path-to-config-file
: Path to the config file used.
root-password
: Password for the root user.
username_:user-password
: Username and the password for that user.
--resume
: Retry installation from the last error.
- Boot the live environment.
- Run the script using the command:
git clone https://github.com/santhanuv/sanarch.git
cd sanarch
python -m sanarch path-to-config-file "root-password" "username:user-password"
python -m sanarch profiles/default.yaml "user123" "archuser:user123"
Example Configuration files are in profiles directory.
- Boot the live environment
- Clone the repo and change into the directory
- Create virtual environment
python -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install the package
python -m pip install -e .
- Run the script directly using sanarch command.
sanarch path-to-config-file "root-password" "username:user-password"
- To deactivate the virtual enviroment run:
deactivate
Custom scripts can be used to setup the system after installation of the base system. Any scripting language can be used for this purpose. To use your custom scripts:
- In the config file use
after-scripts
key to add a list of scripts to run. - Each item in the
after-scripts
list should contain the following keys:
prog
: The program that is used to run the script. eg: bash, pythonpath
: Path to the script.args
: Arguments that should be given to the script.
Logging information can be found in the /tmp/sanarch/arch-install.log. This can be used to debug the errors during the installation.