Unless I'm mistaken, newroot is assigned later, and never referenced in between:
```
(( $# )) || die "No root directory specified"
newroot=$1; shift
```
I grappled with the inability of pacstrap to do this while trying to
setup an i686 chroot for myself based on a pacman config from devtools,
rather than my own config which bombs on a "missing" multilib repo.
Remove the -r option, forcing the user to explicitly pass a root
directory. This removes some confusion wherein we set defaults, but
wouldn't allow all the defaults to be accepted.
This also adds some mild documentation to the help output for genfstab
and pacstrap.
However, add a '-c' switch to use the host cache instead. The default is
useful for when installing a system from an install media (which has
possibly constrained storage), but the '-c' switch is useful when
e.g. creating build-chroots.
I considered doing this the other way around ('-c' being the default).
However, I think it makes sense to default to the expected behavior for
install both because a new user is less likely to know that they need to
add a switch, and because the errormessage they'd get when they run out
of space/memory is nonsensical and would cause lots of annoying
questions.
[dave: use proper array addition, nuke readlink, use arithmetic flag]
Signed-off-by: Tom Gundersen <teg@jklm.no>
This would overwrite an existing mirrorlist, but the one at the host
is known to be good at this point, so the loss is minimal.
Signed-off-by: Tom Gundersen <teg@jklm.no>
We want to be able to call pacstrap with the target being an existing
install (in case it has been severely broken), and hence we might want
to preserve the existing keyring.
Signed-off-by: Tom Gundersen <teg@jklm.no>
the api_mount function could, for some bizzare reason, fail midway
through, leaving the user with a half mounted chroot. set the trap
before the function instead, but mask errors since we might see "foo
not mounted" errors.
* the Makefile uses m4 to build the common lib into the scripts
* it includes install, uninstall and clean targets
* the dist target creates a source tar from a tag
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>