The issue tracker has been moved https://gitlab.archlinux.org/archlinux/archiso/-/issues
FS#16275 - aif cannot update core repository - $repo and $arch variables not set
Attached to Project:
Release Engineering
Opened by Felix (thetrivialstuff) - Sunday, 20 September 2009, 03:49 GMT
Last edited by Dieter Plaetinck (Dieter_be) - Monday, 15 August 2011, 15:33 GMT
Opened by Felix (thetrivialstuff) - Sunday, 20 September 2009, 03:49 GMT
Last edited by Dieter Plaetinck (Dieter_be) - Monday, 15 August 2011, 15:33 GMT
|
DetailsDescription: Using latest aif, I see this message on tty7 during "Refreshing package database...":
error: failed to update core (no servers configured for this repository) it then updates extra and community successfully. core is defined in /etc/pacman.conf and a working mirror is selected in /etc/pacman.d/mirrorlist. Running pacman -Sy manually works fine (core updates and there are no errors). Does this mean that if I continue the install I will get more recent packages from extra and community, but older ones from core? Will that possibly result in a broken system? |
This task depends upon
Closed by Dieter Plaetinck (Dieter_be)
Monday, 15 August 2011, 15:33 GMT
Reason for closing: Fixed
Additional comments about closing: The code has had a big overhaul and is working for me. It used to work for me before too btw, so I don't get why it worked for me and not for you. Either way I explicitly checked for any error messages during the "Refreshing package database" and there were none. Also all packages got installed succesfully. This is with 2011.08.15
Monday, 15 August 2011, 15:33 GMT
Reason for closing: Fixed
Additional comments about closing: The code has had a big overhaul and is working for me. It used to work for me before too btw, so I don't get why it worked for me and not for you. Either way I explicitly checked for any error messages during the "Refreshing package database" and there were none. Also all packages got installed succesfully. This is with 2011.08.15
I commented out the FILE_URL and SYNC_URL variables in the example config because the comments in that file said "everything here is optional" and I couldn't figure out from the example how to specify a repository/sync url properly for a net install (since the example shows a cd install). The code fragment below in lib-pacman.sh looks like it might've wanted those URL's to be set, whereupon it would use them only for core and (possibly) ignore them for extra and community, so when I commented them out it was creating a /tmp/pacman.conf with Server = (blank) for core.
I'm not sure why core is treated differently here, but when I removed that special treatment core was able to update properly and the install appears to be working...
Here's the fix:
Right under "TODO: this is a VERY, VERY dirty hack ..." in /usr/lib/aif/core/libs/lib-pacman.sh there's this conditional:
if [ "$repo" != core ]
then
(some code that includes the pacman mirrorlist from /etc/pacman.d)
else
(some code that effectively disables the core repo's ability to update by forcing it to use the local copy on the cd, which doesn't exist on the netinstall cd)
get rid of that conditional and just replace the whole if/else block with what's in the else.
1) you have this only with an automatic install? not a manual?
2) quote "core is defined in /etc/pacman.conf and a working mirror is selected in /etc/pacman.d/mirrorlist. Running pacman -Sy manually works fine (core updates and there are no errors)."
this means nothing, as the code in question uses $PACMAN_TARGET, which is defined like so:
src/aif.sh
137:PACMAN_TARGET="pacman --root $var_TARGET_DIR --config /tmp/pacman.conf"
($var_TARGET_DIR is /mnt)
3) automatic procedure inherits from base, so first worker_configure is executed, then worker_select_source. the former sources the config file, the latter sets the var_FILE_URL and var_SYNC_URL variables
target_prepare_pacman() then uses those internal variables to set the value of serverurl (depending on whether we use net/cd).
okay, so far with the default example generic config (or with the 2 lines commented out, shouldn't matter) this means cd -> file:///src/core/pkg and net -> '' (empty string)
4) what happens then, for core repository, we use serverurl (which can be a mirror, a local path (file:///..), or still '' if the user is doing netinstall but did not choose a mirror).
for _other_ repositories, we are sure we never have this locally (we only have images with the core repo on it, or no repo at all), so we configure them to use $var_MIRRORLIST (which is "/etc/pacman.d/mirrorlist")
how we treat core is actually how we should treat everything, (the else branch), the if branch is a dirty fallback.
what you are proposing is to tell *non-core* repositories to use the same setting as core, which does not make much sense to me . maybe you mixed up the if/else part in your explanation. i would understand when you would say "use the if branch for every repo"
in your case - if i understand correctly -
1) you use net install but did not select a mirror (or did you?)
2) since the above settings obviously won't work, you run into problems. you think the problem gets solved by pointing everything to /etc/pacman.d/mirrorlist, which probably (I'm not sure!) contains at least one mirror by default, so it looks like the problem is solved, but you're just workarounding the real problem.
::head of aif profile/config::
SOURCE=net
SYNC_URL=http://mirrors.kernel.org/archlinux/$repo/os/$arch
::squid access.log::
TCP_MISS/404 256 HEAD http://mirrors.kernel.org/archlinux//os/core.db
TCP_MISS/200 316 HEAD ftp://mirrors.kernel.org/archlinux/extra/os/i686/extra.db
TCP_MISS/200 481382 GET ftp://mirrors.kernel.org/archlinux/extra/os/i686/extra.db
TCP_MISS/200 316 HEAD ftp://mirrors.kernel.org/archlinux/community/os/i686/community.db
TCP_MISS/200 455330 GET ftp://mirrors.kernel.org/archlinux/community/os/i686/community.db
see the missing "core" and "i686" in the first squid line
for a workaround i set $repo and $arch in the head of the aif profile/config
It should be okay to have literal $repo and $arch variables (please, do not put them in your aif config file!), they should go in the pacman config and pacman should replace them.
See https://github.com/Dieterbe/aif/commit/ade00e78d492a05704e082e4861297fa0a10a9f1 for detailed list of changes
Please retest with testbuilds 2011.08.13 or newer