archinstall icon indicating copy to clipboard operation
archinstall copied to clipboard

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

Open vanillaSprinkles opened this issue 1 year ago • 4 comments

error'ing behavior:

  • a user may want to add a local-mirror (not a repo) to the list of mirrors - and instead a repo is created within the arch-live's /etc/pacman.conf
  • this will then look for the repo's DB file and causes archinstall to fail
  • finally upon trying to relaunch the archinstall, it fails immediately saying the repo cannot be found, check your internet (due to arch-live's pacman.conf file having a new-repo added to it, where the DB file can fail to exist)

potential solutions:

  • a huge improvement: copy the /etc/pacman.conf and /etc/pacman.d/* files to a well-stated-location, then reference them when setting up the system.

  • the add mirrors-prompt currently should read: add custom repo

    • maybe give a hint to overwrite core, extra, multilib, ect
  • another prompt to add mirror (or default mirror replacing /etc/pacman.d/mirrorlist )

vanillaSprinkles avatar Mar 05 '24 09:03 vanillaSprinkles

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

svartkanin avatar Mar 08 '24 04:03 svartkanin

@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

  • i think there should be 2 options for this;
    • one to add to the Repository Section
    • one to add/replace-all mirrors in the mirrorlist (where, by default, each of the default Repository Sections point to)

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)

vanillaSprinkles avatar Mar 08 '24 09:03 vanillaSprinkles

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.

  1. 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.

Torxed avatar Mar 08 '24 10:03 Torxed

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 )

vanillaSprinkles avatar Mar 11 '24 21:03 vanillaSprinkles