You are not logged in.

#1 2019-11-11 05:32:10

esotericnonsense
Member
Registered: 2019-11-11
Posts: 4

autoarch - unattended installation for arch linux virtual machines

Hi all,

I've put together a script for unattended installations of Arch in VMs. The script could be modified to allow for installs on generic machines given the correct interface and partitioning information.
It also has the ability to use an optional dotfiles repository.

On my machine it allows me to boot a blank VM and completely install Arch + run my dotfiles script and end up with a working development environment.

Repository is here: https://git.sr.ht/~esotericnonsense/autoarch

A blog post on how I got to this point is forthcoming.

Cheers,

~esotericnonsense (Daniel Edgecumbe)

Last edited by esotericnonsense (2019-11-11 05:32:19)

Offline

#2 2019-11-11 05:40:10

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

Re: autoarch - unattended installation for arch linux virtual machines

esotericnonsense wrote:

A blog post on how I got to this point is forthcoming.

Be still my heart...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-11-11 06:11:17

esotericnonsense
Member
Registered: 2019-11-11
Posts: 4

Re: autoarch - unattended installation for arch linux virtual machines

jasonwryan wrote:
esotericnonsense wrote:

A blog post on how I got to this point is forthcoming.

Be still my heart...

Terribly exciting, I know. wink

I think it'd be useful to put the information out there to help others who want to do this sort of thing in the future. There are a lot of annoying trial-and-error bits that can be avoided.

Of course you can just like, look at the source. smile

Last edited by esotericnonsense (2019-11-11 06:11:35)

Offline

#4 2019-11-11 12:58:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: autoarch - unattended installation for arch linux virtual machines

In preparing the mirrorlist ...

grep "Server" "${mirrorlist}" | sed 's/^#Server/Server/g' | sort -R > ...

There is never any reason to pipe grep to sed, and the 'g' flag there does absolutely nothing (except perhaps make sed less efficient if it is not smart enough to ignore it due to the begining-of-line anchor).  This is equivalent:

sed -n 's/^#Server/Server/p' "${mirrorlist}" | sort -R > ...

But the `sort -R` is the real oddity here.  Why one earth would you uncomment every mirror on earth then randomize them?  This way a large portion of installs will be assured to get an absolutely horrible mirror for their location.

Last edited by Trilby (2019-11-11 12:59:14)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2019-11-12 21:58:10

esotericnonsense
Member
Registered: 2019-11-11
Posts: 4

Re: autoarch - unattended installation for arch linux virtual machines

I am clearly no sed ninja; you've made me aware of the other commands, and I'll spend some time now on reading the docs. Thanks!

Regarding sort -R; you're right, it doesn't make a lot of sense. For my own use case I'm always using a local mirror anyway.

The reason it's there is actually because I want to eventually make a reproducible ISO (by requiring specific versions/hashes of packages as input, build dates, etc) and I aimed to tackle the mirrorlist first (perhaps by, for example, just blanking it entirely and fetching it on boot).

The randomness means then that it's very-much-not-reproducible and I won't miss it when tackling it eventually.

Offline

#6 2020-04-03 11:51:41

njam
Member
Registered: 2017-05-04
Posts: 6

Re: autoarch - unattended installation for arch linux virtual machines

Thanks for sharing!

Do you know about mkosi? I'm experimenting with using it for a similar use case. It comes with configuration for unattended Arch installation, and allows for customizing the image with a post-install script ("--postinst-script").

Offline

Board footer

Powered by FluxBB