archlinux / archinstall

Arch Linux installer - guided, templates etc.
GNU General Public License v3.0
5.95k stars 514 forks source link

bug: changing mirros within prompt/json of archinstall should not change live-cd /etc/pacman.* files #2379

Open vanillaSprinkles opened 5 months ago

vanillaSprinkles commented 5 months ago

error'ing behavior:

potential solutions:

svartkanin commented 5 months ago

I think this fixed the issue https://github.com/archlinux/archinstall/pull/2350

vanillaSprinkles commented 5 months ago

@svartkanin nice thanks

did a lazy-sync of master to the current archiso via find "/usr/lib/python3.11/site-packages/archinstall/" -type f -printf "%P\n" | xargs -I{} curl -sL https://raw.githubusercontent.com/archlinux/archinstall/master/archinstall/{} -o /usr/lib/python3.11/site-packages/archinstall/{}

guided mode still overwrites arch-live's /etc/pacman.conf and adds a repo

in guided mode, it ill be beneficial to the user to see a suggestion to overwrite the default repositories; though in my current case; it simply added a duplicate [Core] section to /etc/pacman.conf ; im not 100% sure the intended behavior on duplicate sections

it is therefore still possible for the ending arch-live iso to contain modified pacman files - upon crashing out of archinstaller - and to not be able to re-start archinstaller until the /etc/pacman.conf is manually corrected (with the ensure network error as output)

Torxed commented 5 months ago

The ideal outcome would be to have two options:

1) Selecting a mirror region 2) Being able to add a custom mirror URL

None of these options should create new [repo] entries (core',extra,multi-libetc) as that would look forhttps://my-mirror.lan/{repo name}.db.tar.gzwhich would cause issues if the local server that is most likely just a cached version of upstream mirrors (meaning it will havecore.db.tar.gz` etc as if it was any normal mirror.

However both of these options should change the pacman.d/mirrorlist since there's a point to the user making these mirror choices for retrieving packages.

And the two should be select:able together, and custom mirror URL's should probably be prioritized as it most likely holds a important role.

3) Being able to add a custom [repo] definition

I don't think we support this atm, and if we "do" it's most likely a bug. Since it operates differently from the other two options and needs additional questions. Where for instance I run a AUR mirror locally with my built packages, those would not be found in the signed core.db.tar.gz and has to be in its own repo definition:

[myAURs]
SigLevel = Optional TrustAll
Server = https://my-mirror.lan/

Where pacman would look for https://my-mirror.lan/myAURs.db.tar.gz and find packages from this database when strapping in.

And when specifying the [repo] it needs to be accompanied with a server URL/URI as well, since it won't be found on any of the servers hosting at /etc/pacman.d/mirrorlist. It could be the same as "Custom URL", but we shouldn't assume that's the case, we could suggest it as default input - but it could be a different server or URL even. Since the Custom URL can just be a local cache of official mirrors and nothing else to speed up strapping, but fallbacks are normal servers. And depending on how the admin sets up the reverse proxy for instance the AUR could be at a different location like https://my-mirror.lan/.

If the server admin however does it nicely, they should be doing Server = https://my-mirror.lan/archlinux/$repo/os/$arch and thus the custom url can be the same for both "official repo's" and the special repo, as it gets replaced in the URL definition.

Either way, I don't think we support this through UI questions. And manually defining the JSON conf doesn't have a parser for this yet?


The third option would for sure be very beneficial for, in my case as an example, corporate environments that build in-house applications using PKGBUILD + makepkg and want to host it locally so that we can strap it into our containers or ISO's using pacman.. But without sabotaging official repo databases, signatures etc.

vanillaSprinkles commented 5 months ago

i think at the moment the guided setup adds the [Repo] to pacman.conf, and latest master also adds it to the mirrorlist file ( i forget if it appends or adds it to the top - i will check again soon(tm) and edit ) ( i would want the added mirrors to the top of the file for prio, or have another option to wipe out existing and add only specified )