My reasons were:
By writing a script you still learn about your system. In fact when you learn something, you can adjust your script and document it for every future install.
You can isolate bugs better with a reproducible system.
I switch computers on a regular basis, e.g. at work. And i don't want to spend hours of installation, optimization and might forget something like ucode and never notice it.
Suppose your system has a weird bug, maybe with xorg. Maybe you don't have the nerve to fix this and not the time to ask the forum.
I went through some dependency-hells and installed some unnecessary packages explicitly and might carry them around. Having the option to reinstall the system allows some bold approaches.
Programs leave files with weird names. I wish i didn't have to learn what .purple or trolltec means.
Isn't it cool to walk around the world and have your fully personalized arch just 20 min. away from every pc with internet.
@Trilby: it's still subjective, the way I defined it is how I see it for me. I'll end this discussion here though because it's very open ended and I don't want to derail too much.
Another thing that I remembered these days was btrfs. You can be fancy by creating a bunch of partitions and immediately snapshotting them, and then "cleaning" your system later on by resetting some of its snapshots. I think I recall a few blog posts that preached that. Not very KISS though.
]]>thiagowfx wrote:the definition of "cleaning" is open and subjective.
You litterally just defined it in your previous post as reinstalling the system. But hey, I guess I'm just trolling according to you, so don't mind me.
Pretty sure he wrote 'toiling' (I read it as trolling initially too).
]]>the definition of "cleaning" is open and subjective.
You litterally just defined it in your previous post as reinstalling the system which should never be necessary.
EDIT: *headdesk* thank for the correction bellow, and sorry for my poor initial reading.
]]>Yes. Running arch linux requires thinking. Anyone averse to this would be best served not by continually reinstalling arch, but rather by installing some other OS.
Thinking is good. Toiling is not. I personally like the idea of a "clean.sh" script that is incremented over time that you run every few months or so. And then, every time you find something new to clean (according to your own use case and system), you add it to the script so you don't have to worry about it in the future. This prevents you from trying to "reinventing the wheel" every time a new cleaning operation is performed -- the definition of "cleaning" is open and subjective.
]]>Most operations are reversible but do require some thinking.
Yes. Running arch linux requires thinking. Anyone averse to this would be best served not by continually reinstalling arch, but rather by installing some other OS.
]]>In particular don’t get caught in the endless “next time it will be perfect” loop. It will never be, because you repeat the same mistakes over and over again. Instead try to precisely define the dirtyness in your system. This way you break through the barrier you are probably dealing with now: seeing it as a huge, fuzzy, unattackable enemy. Then search how deal with it. This way you learn how to manage your system in a way that lets you keep it clean.
mpan, the owner of a 7+ years old Arch installation
]]>You should never have to reinstall arch. Nuking the system and reinstalling from scratch (with or without a script) is robbing you of the opportunity to learn how to actually manage an arch system.
zorggy wrote:the installations quickly become dirty and sometimes instable.
Define dirty. Clean it.
OP probably means: temporary files, cache, /var, hidden directories within /home (e.g. .local, .cache, .config), packages that are accumulated over time. Most operations are reversible but do require some thinking. For example, you can always nuke your $HOME and start over, but you can't do it on /var.
You can rely on a few things like paccache, bleachbit, systemctl reboot (ok, this one is just sarcasm). But it is not trivial to reset your system to a "clean" state without reinstalling it.
]]>As writing my first post, I realized I could give Bash a try, because I feel it's heavy to write the program in C++ and I don't know Rust even if I believe it's a good language.
So I've translated the installation config file from YAML to a Bash file that will have to be sourced. Here is the code:
#!/bin/bash
PRE_INSTALL_EXEC=
POST_INSTALL_EXEC=post-install.sh
KEYBOARD=
BOOTMODE=UEFI
SYSTEMDISK_DEVICE=/dev/nvme0n1
SYSTEMDISK_FORMAT=TRUE
SYSTEMDISK_TABLE=gpt
declare -a PARTITIONS # ( device mountpoint type sizeMiB label boot )
PARTITIONS[0]=(/dev/nvme0n1p1 /boot fat32 512 boot TRUE)
PARTITIONS[1]=(/dev/nvme0n1p2 / ext4 32768 linux FALSE)
PARTITIONS[2]=(/dev/nvme0n1p3 /opt ext4 32768 opt FALSE)
PARTITIONS[3]=(/dev/nvme0n1p4 /home ext4 100% home FALSE)
MIRRORS=('https://archlinux.repo...' 'https://other_archlinux.repo...')
ENCRYPTED_ROOT_PASSWORD='letters_and_numbers'
TIMEZONE=Continent/City
LOCALIZATION=(en_US.UTF-8)
DEFAULT_LANG=en_US.UTF-8
FQDN=desktop.domain.com
NETWORK_DNS=(192.168.1.1 9.9.9.9)
NETWORK_DOMAINS=(mydomain.com)
BOOTLOADER_TYPE=systemd-boot
BOOTLOADER_TIMEOUT=3
BOOTLOADER_TITLE=ArchLinux
FINAL_REBOOT=TRUE
It's not as readable as YAML format, in my opinion. But it's finally more compact. And no need to install python3 just to run the second script. I've already the Bash scripts but I now need to use the sourced variables instead of directly writing them in the code.
I'll write the different installation possibilities, such as BOOTMODE=bios, BOOTLOADER_TYPE=grub and provide the possibility to use NetworkManager instead of systemd-networkd.
I can finish this little project and be able to re-install in few minutes my hosts. Thank you!
]]>the installations quickly become dirty and sometimes instable.
Define dirty. Clean it.
Why would it be unstable? Define unstable.
]]>