This mainly fixes the case where there's devices mounted under the
chroot directory. Creating a bind mount on top of this will obscure
these other mounts.
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 %b formatter is too generic for us to use, as a sequence such as
'\b' is invalid for hex escaping, but valid for %b. Port over the logic
from util-linux's mangle mini-lib and use this instead. This supports
both 3 digits hex as well as 3 digit octal escapes, and will ignore the
more generic ascii based single character escapes. Output is always in
octal format to comply with fstab(5).
* 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>
Help the admin tweak the generated fstab file by adding as much info as we have in the comment for each entry.
Signed-off-by: Tom Gundersen <teg@jklm.no>