Seeking Help Scripting My Arch Linux installation
Hey all, so I'm attempting to script my Arch Linux insallation using bash. Essentially I'm trying to script this installation method. Problem is, I don't have much experience with bash scripting, so I've uploaded the draft for the script to github here.
The main thing I'm asking for help with scripting is:
-
Creating the user account, while adding it to the wheel group and creating that users' /home/user directory, all while accepting input for the username and password through something like the read command. Then setting the root password also with input whenever it's run.
-
Setting the repositories in /etc/pacman.conf
Anyone with bash scripting experience care to lend a hand?
Thanks in advance
About this post
- Posted
- Archived
- Score
- 1 · 100% up
- Kind
- Text
- ID
- 4itz5a
13 comments
I'm kind of hacking on something similar for myself:
https://github.com/EnigmaCurry/arch-quickstart
All of the scripts I've seen make what you just wrote here over complicated, thanks, /u/EnigmaCurry!
First I'd like to ask what the need for scripting this is?
Its a repetitive task that requires some attention to detail and is likely to be the same every time. A great candidate for scripting.
Exactly, thank you.
I find my self reinstalling often enough that I want to make the process quicker.
In my experience, the most time, by far, is spent downloading packages. For any new install, I always use a USB full of packages I have saved. So, almost all download time is eliminated.
How an install goes for me:
2 min - partition, create and mount filesystems.
2 min - pacstrap in base, base-devel, vim, xorg, reflector, grub... (the basics)
3 min - pacman (originally from usb) in the DE or WM as needed. I have these pretty memorized.
3 min - post install config (adding users, setting passwords, configuring DE/WM. I now use i3wm and use the same .config file between all similar installs.
Using the -c option on pacman and pacstrap is a huge timesaver.
Just some thoughts.
Thats.. not a very good reason. Sure you can reinstall as soon as something breaks, but that way you'll have a system that works due to dumb luck until the next major update.
... Apparently he got inspired by two scripts I showed him which I constantly use to setup VMs for testing development stuff or updating managed packages (I'd like to have completely clean machines so I know the package dependencies haven't changed).