FS#35434 - Allow using pacstrap without internet connection

Attached to Project: Arch Linux
Opened by Chee-Yang Chau (ccy) - Thursday, 23 May 2013, 02:50 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 23 May 2013, 19:33 GMT
Task Type Feature Request
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 0
Private No

Details

The pacstrap script always sync the package database list with mirrors via Internet as indicated in this line of code:

if ! pacman -r "$newroot" -Sy "${pacman_args[@]}"; then

It would be great if the pacstrap offer an option to use in offline mode.

I attached a version written by teateawhy posted to https://bbs.archlinux.org/viewtopic.php?
pid=1276604#p1276604
   pacstrap (6.6 KiB)
This task depends upon

Closed by  Dave Reisner (falconindy)
Thursday, 23 May 2013, 19:33 GMT
Reason for closing:  Won't implement
Additional comments about closing:  This isn't trivial, and calling pacman is more suited to the task.
Comment by Dave Reisner (falconindy) - Thursday, 23 May 2013, 11:48 GMT
pacstrap in "offline" mode is called pacman.
Comment by Lukas B (teateawhy) - Thursday, 23 May 2013, 17:34 GMT
You really think we can replace
# pacstrap /mnt base
with
# pacman /mnt base
and get the same result?
Comment by Dave Reisner (falconindy) - Thursday, 23 May 2013, 17:40 GMT
No, I don't, and that's not what I claimed.
Comment by Lukas B (teateawhy) - Thursday, 23 May 2013, 18:12 GMT
Ok, i agree, that is not what you said.
Regarding the bug report, i think there are 4 options now:
1. Close this bug report without commiting changes. If people want "offline" mode let them enter the necessary pacman command.
2. Introduce this option which does not change default behaviour of pacstrap, and can be used for "offline" mode.
3. Change the default pacman command in the pacman script from 'pacman -Sy' to 'pacman -S'. Then the old behaviour comes back with 'pacstrap -y /mnt base'.
4. Something else

My suggestion is number 2., and i am interested in your opinion about this.
Comment by Dave Reisner (falconindy) - Thursday, 23 May 2013, 18:24 GMT
My suggestion is to test your proposal. You cannot install without sync DBs present in the new root.

# mkdir foo
# ./pacstrap -do foo
==> Creating install root at foo
==> Installing packages to foo
warning: database file for 'staging' does not exist
warning: database file for 'testing' does not exist
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community-staging' does not exist
warning: database file for 'community-testing' does not exist
warning: database file for 'community' does not exist
warning: database file for 'multilib-testing' does not exist
warning: database file for 'multilib' does not exist
error: target not found: base
==> ERROR: Failed to install packages to new root


I'm inclined to go with #1 as the logic required to copy existing sync DBs to the new chroot is more complex than I want it to be for an *edgecase*. #3 isn't an option as it changes the interface and breaks the majority use case. Feel free to try and convince me otherwise but I don't think there's going to be anything done here.
Comment by Lukas B (teateawhy) - Thursday, 23 May 2013, 19:12 GMT
Yes, it is necessary to supply the db files and cache to pacman. That is why the original poster Chee-Yang Chau (ccy) has mounted the necessary directories before. With those directories the new pacstrap worked for his installation. I saw the link to the forum is broken. If you want you can follow this link instead:
https://bbs.archlinux.org/viewtopic.php?pid=1276896#p1276896

It seems that this offline functionality is harder to achieve, than i have thought before. Go with #1 then.




Loading...