You are not logged in.

#1 2021-12-22 23:51:57

goldmund
Member
Registered: 2021-02-15
Posts: 62

Own installation script feasible?

Hi,

I've been playing with the idea of writing my own Arch installation script already for some time. I don't install Arch all that often, but the ability to do so in a matter of minutes intrigues me. I guess it's not completely necessary, it's just that my tinker-self came up with this new toy and my brain makes me think of that stupid installer script several times a day. I even wake up in the middle of the night and think of my script. Writing it is probably my only medicine, I guess.

I am well aware of the new official Arch Installer, but I much more prefer running something I have written myself, because I know exactly what happens.

Yesterday I started writing and the script is already some 200 lines long. I want to make this safe, so I am running lots of checks in between. I still partition the drive manually and only deploy the script after chrooting. At the end I would like to have a fully functioning system with encryption, btrfs, xorg, dwm and so on and it should look so normal that I shouldn't be able to notice that the system was reinstalled at all.

Now to the point of the problem: Although I have only been an Arch user for a year, I know that the Installation guide changes from time to time. The guidance is to always follow the Installation guide, even if one is very familiar with it, just in case something has changed. However, this sounds like that the use of a private installation script should probably be discouraged. Am I right? On the other hand, I did hear of many Arch users who use their script quite happily. But I can't imagine going through and changing tens/hundreds of lines on a regular basis!

How do you go about it? Do you have your own installation script? Do you update it often? Does your script only cover certain parts of the installation or more or less the whole process?

Or should I just forget about it? Please no!

Offline

#2 2021-12-23 01:30:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,046
Website

Re: Own installation script feasible?

If you want your own script, knock yourself out. Just don't share it as one of the many "easy Arch installers".

Personally, I install Arch so infrequently, and it takes so little time (apart from the downloading, and a script won't change that), that I see little point in it.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Online

#3 2021-12-23 09:08:21

goldmund
Member
Registered: 2021-02-15
Posts: 62

Re: Own installation script feasible?

jasonwryan wrote:

If you want your own script, knock yourself out. Just don't share it as one of the many "easy Arch installers".

Personally, I install Arch so infrequently, and it takes so little time (apart from the downloading, and a script won't change that), that I see little point in it.

Yes, well, the Arch install itself doesn't take so much time, it's the configuration afterwards which can be a little tedious.

So you don't see an issue with having an install script being used and not updated, maybe even for years? I'd like to have something stable...

Offline

#4 2021-12-23 10:26:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,406

Re: Own installation script feasible?

You'll always have to update things as things change, if you don't want to do that use a distribution that ensures backwards compatibility.

FWIW this sounds like a conflict of interests to me. Why are you interested in writing a script and then not in maintaining it? There have been comparatively little changes just from a "guide" perspective and you could change things just as iteratively as the guide changes. If you don't want to do that, why  bother with the much more time intensive initial task of writing a script if you are then afraid of having to do changes to it?

Also jasons point is somewhat important, how often are you reinstalling or thinking of reinstalling Arch and for what reason? I've installed Arch 3 times, when I've first started using it 9 years ago, 3 years after that when I changed HW, and now a few months ago when I changed HW from that, technically a reinstallation wouldn't have been necessary for any of these (and in the second case I carried over the entire $HOME disk) but I intentionally reinstalled to clean out some cruft and I expect this installation to hold me over for at least another 6 years assuming no HW failure.

Last edited by V1del (2021-12-23 10:36:47)

Offline

#5 2021-12-23 10:57:03

goldmund
Member
Registered: 2021-02-15
Posts: 62

Re: Own installation script feasible?

Thanks for confirming my doubts, V1del.

The reason I want to reinstall is that I want to switch from ext4 to btrfs. So I thought I save myself some work and write a script, in case I need to reinstall in the future again. But writing and maintaining it sounds actually like more work. It's a good point to ask, how often I am going to reinstall.

It's also good to know that even well-seasoned Arch users like you don't have an install script.

Offline

#6 2021-12-23 11:11:02

progandy
Member
Registered: 2012-05-17
Posts: 4,965

Re: Own installation script feasible?

goldmund wrote:

So I thought I save myself some work and write a script, in case I need to reinstall in the future again. But writing and maintaining it sounds actually like more work.

I think it may be a good idea to create at least a text file to document your configuration. Even if it doesn't work as an automated script you will know what to do to get to your preferred setup.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2021-12-23 11:21:27

goldmund
Member
Registered: 2021-02-15
Posts: 62

Re: Own installation script feasible?

progandy wrote:

I think it may be a good idea to create at least a text file to document your configuration. Even if it doesn't work as an automated script you will know what to do to get to your preferred setup.

Yes, I already have a text file to help me create my setup. But actually it's no different than an installation script, because a text file can also get outdated.

Offline

#8 2021-12-28 16:41:09

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: Own installation script feasible?

I found this thread because I'm expecting a new laptop (\0/) and as my current one was installed six years ago, I'm researching changes in current best practices. At the same time, I have no idea which choices I made 6 years ago, so a lot I will have to look for manually. I agree that the customizing can be tedious

My personal recommendation to the OP'er is to:
1. Either use the new archinstall option and use that to script your own install - just assume that you will reiterate the install a few times until you are satisfied with the basic options, and then saving the archinstall install script will help you through those reiterations easily
2. And/Or use Ansible. I have switched all my configuration work for the office I'm admin for to ansible plays+roles, and it is just the bomb. Not sure I would go through the hassle for a single personal laptop, but it would help with my next reinstall (probably 6 years from now) as I then have a basis to start from. Yes, it requires maintenance, but you can set it up in modules, and use conditions, so much more fun to maintain then a boring shell script wink

HTH

Offline

#9 2021-12-28 22:42:59

jonno2002
Member
Registered: 2016-11-21
Posts: 343

Re: Own installation script feasible?

both goldmud and zenlord do NOT need to re-install anything, just copy the system over using rsync or whatever.

goldmud if you want to switch file systems just copy the system to another drive/partition then format with new filesystem then copy the system back.

i never understand peoples obsession with re-installing, boggles my mind, so much work for no reason.

Offline

#10 2021-12-29 17:24:43

goldmund
Member
Registered: 2021-02-15
Posts: 62

Re: Own installation script feasible?

I have eventually decided to write my own installation and configuration script and it's working beautifully. I have my dwm desktop set up and running in 15 minutes. Yes, I will have to maintain it, but I would have to maintain my own "installation notes" just the same. I guess I will be checking the history of the Arch Wiki Installation Guide from time to time, just to see if anything major has been changed.

No, I won't publish it! I'll let everyone else have fun with putting their Lego pieces together.

Offline

#11 2021-12-29 17:27:43

goldmund
Member
Registered: 2021-02-15
Posts: 62

Re: Own installation script feasible?

zenlord wrote:

My personal recommendation to the OP'er is to:
1. Either use the new archinstall option and use that to script your own install - just assume that you will reiterate the install a few times until you are satisfied with the basic options, and then saving the archinstall install script will help you through those reiterations easily
2. And/Or use Ansible. I have switched all my configuration work for the office I'm admin for to ansible plays+roles, and it is just the bomb. Not sure I would go through the hassle for a single personal laptop, but it would help with my next reinstall (probably 6 years from now) as I then have a basis to start from. Yes, it requires maintenance, but you can set it up in modules, and use conditions, so much more fun to maintain then a boring shell script wink

1. The new archinstall script is good and all, but I like to get my hands dirty and want to know exactly what I am doing.

2. Funny you should mention Ansible! I've heard lots of good stuff about it, but never tried it myself. Before writing the Bash script I researched Ansible, but found hardly any comments about using it for an Arch install, therefore I decided against it. Do you (or anyone else) think that it's suitable for an Arch installation? Sure, I am not deploying 100+ servers, but there is an element of fun in it.

Offline

#12 2021-12-29 17:30:02

goldmund
Member
Registered: 2021-02-15
Posts: 62

Re: Own installation script feasible?

jonno2002 wrote:

both goldmud and zenlord do NOT need to re-install anything, just copy the system over using rsync or whatever.

goldmud if you want to switch file systems just copy the system to another drive/partition then format with new filesystem then copy the system back.

i never understand peoples obsession with re-installing, boggles my mind, so much work for no reason.

I agree with you that reinstalling and re-configuring Arch is a lot work. However, it's a nice feeling to do a reinstall every few years and get rid of lots of accumulated garbage. Just like a detox for the body!

Offline

#13 2021-12-29 21:27:55

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,391

Re: Own installation script feasible?

goldmund wrote:

Before writing the Bash script I researched Ansible, but found hardly any comments about using it for an Arch install, therefore I decided against it. Do you (or anyone else) think that it's suitable for an Arch installation?

Well there is an entire page devoted to it in the ArchWiki so some people seem to think it's suitable. Never used it myself though.

Offline

#14 2021-12-29 22:24:32

jonno2002
Member
Registered: 2016-11-21
Posts: 343

Re: Own installation script feasible?

goldmund wrote:

it's a nice feeling to do a reinstall every few years and get rid of lots of accumulated garbage. Just like a detox for the body!

i do that regularly without re-installing, its called maintaining your system.
https://wiki.archlinux.org/title/System … filesystem

also "lostfiles" is a good tool for finding files not owned by a package.

Offline

#15 2021-12-29 22:35:12

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,995
Website

Re: Own installation script feasible?

Scripting an install is definitely feasible and practical.

For example, for a short while there, I had a small fleet of VPSs that I had to bootstrap into arch (because the VPS provider didn't officially support it). Because I had a basic set of things I wanted to get ready on each VPS when I deployed a new one (which I did very frequently), it became incredible helpful to have that process automated.

Echoing Jasonwryan though, don't try to advertise it as an easy way to install arch. It won't be supported here. smile

All the best,

-HG

Offline

#16 2021-12-31 05:29:41

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: Own installation script feasible?

jonno2002 wrote:

both goldmud and zenlord do NOT need to re-install anything, just copy the system over using rsync or whatever.

Absolutely. There's maybe one situation where that is not possible: if your current system is broken, lost, stolen... Having your configuration available in (versioned) scripts gives a kind of comfort, but maybe that's just my nature as a control-freak playing tricks on me.

Offline

Board footer

Powered by FluxBB