FS#58778 - [arch-install-scripts] warning: option --root is deprecated; use --sysroot instead

Attached to Project: Arch Linux
Opened by Sean Enck (enckse) - Tuesday, 29 May 2018, 14:42 GMT
Last edited by Jelle van der Waa (jelly) - Monday, 18 September 2023, 17:53 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
looks like pacstrap is still calling pacman (5.1.0) with "-r" which is deprecated

Additional info:
arch-install-scripts 18-1
pacman 5.1.0-1

Steps to reproduce:
install pacman 5.1.0 and pacstrap (e.g. a systemd-nspawn container)

looks like this is where the message is produced:

msg 'Installing packages to %s' "$newroot"
if ! pacman -r "$newroot" -Sy "${pacman_args[@]}"; then
This task depends upon

Closed by  Jelle van der Waa (jelly)
Monday, 18 September 2023, 17:53 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/a rch-install-scripts/issues/61
Comment by Eli Schwartz (eschwartz) - Tuesday, 29 May 2018, 14:54 GMT
  • Field changed: Summary ([arch-install-scripts] warning: option --root is deprecated; use --sysroot instead → {arch-install-scripts} warning: option --root is deprecated; use --sysroot instead)
  • Field changed: Status (Unconfirmed → Assigned)
  • Field changed: Category (Packages: Extra → Arch Projects)
  • Task assigned to Dave Reisner (falconindy)
Yes, it was deprecated because of --sysroot which assumes an existing system (existing enough to read the pacman configuration fully from the chroot).

The --root option is not going away any time soon, so we have time to figure out the best way to handle this.

It might be enough to pre-create /etc/pacman.{conf,d/} and /var/{cache,lib}/pacman/
Comment by Eli Schwartz (eschwartz) - Tuesday, 29 May 2018, 16:43 GMT
Inital stab at implementing this is in https://git.archlinux.org/users/eschwartz/arch-install-scripts.git/log/

Unfortunately it doesn't work due to the --sysroot not having internet. Note: this works fine in an existing chroot.
Comment by Tobias Powalowski (tpowa) - Saturday, 23 June 2018, 07:32 GMT
I have the same issue for archboot install scripts, copying resolv.conf does not help either.
Comment by Tobias Powalowski (tpowa) - Saturday, 23 June 2018, 08:58 GMT
Ok found the solution for the network issue:
- /etc/resolv.conf from host system is needed in sysroot
- /usr/lib/libnss_dns.so.2 from glibc is needed in sysroot
Hope this helps.
Comment by Eli Schwartz (eschwartz) - Sunday, 24 June 2018, 02:40 GMT
Unfortunately copying these over results in pacman --sysroot "$newroot" -Syu base trying and failing to initially install those files. But yes, the issue is definitely the fact that --sysroot is trying to use the chroot's internet resolution (which doesn't work on a completely empty root). I'd mentioned this to agregory on the #archlinux-pacman IRC channel, and IIRC he said he'd try to look into a proper fix.

No news yet, but it's definitely a reason why we're not intending to remove the --root option in any upcoming pacman 6.x release. At least until --sysroot can properly handle bootstrapping a new system.
Comment by Johannes Ernst (jernst) - Monday, 02 July 2018, 19:19 GMT
IMHO the manpage needs to be reverted. Right now, it does not mention --root at all any more, which leaves people like me trying --sysroot and failing with no obvious next step.

Also, as long as --sysroot is not a complete replacement for --root, the "obsolete" warning should not be there because clearly it isn't.
Comment by Olivier Galibert (galibert) - Thursday, 28 February 2019, 12:22 GMT
It's also extremely useful to manage an installation for a different cpu in a subdirectory (nfsroot, sdcard partitions). And in that case you'll never have a usable nss shared library in the sysroot.

Currently even --root doesn't work because the alpm library fails to initialize because it's not getting the --root information and looks for the packages in the wrong place. It's rather annoying.

OG.
Comment by mirh (mirh) - Wednesday, 08 January 2020, 12:56 GMT
Similarly, I can also report about how --root saved my day with a very badly corrupted glibc installation (which was making any chroot attempt from livecd fail).

I get why sysroot is probably what users are actually looking for in 95% of situations... But it still has its very own use cases as a last ditch command I guess. And if you could just reword its description (or just casually mention it in sysroot's one, if you think it's deceiving?) it would be helpful imo.
Comment by Conrad Hoffmann (conrausch) - Tuesday, 08 September 2020, 19:08 GMT
Just came across this, looks like in the current version of pacman (5.2.2) this is no longer an issue, --root is properly documented in the man page and there is no warning about deprecation. I'd say this can be closed?
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...