Commit Graph

238 Commits

Author SHA1 Message Date
Dave Reisner
f8e7c4e29d direct error output to stderr 2012-06-25 22:33:38 -04:00
Dave Reisner
0537563148 use blkid for uuid/label instead of lsblk
This works around something that seems might be a bug in lsblk where-in
detection of UUIDs fails for certain devices when invoked as non-root.
2012-06-22 20:28:37 -04:00
Dave Reisner
80ed096ccf arch-chroot: Only conditionally use a bind mount on chroot
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.
2012-06-22 19:04:46 -04:00
Tom Gundersen
7d8ef4c747 pacstrap: store cache on target system by default
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>
2012-06-22 18:55:04 -04:00
Tom Gundersen
e032c0305e pacstrap: copy the mirrorlist from the host to the new root
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>
2012-06-22 18:55:04 -04:00
Tom Gundersen
c5c20fd966 pacstrap: don't copy over keyring if it exist already
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>
2012-06-22 18:55:04 -04:00
Dave Reisner
074a12023f Merge pull request #3 from pierres/master
$newroot might be a relative path, so remove the leading slash.
2012-06-22 06:39:32 -07:00
Pierre Schmitz
b0af617480 pacstrap: Fix creation of default directories
$newroot might be a relative path, so remove the leading slash.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-22 15:33:11 +02:00
Dave Reisner
f4a7a8313a fix xtrace output on api mount 2012-06-20 10:26:50 -04:00
Dave Reisner
49e855638e use intermediate var for chrootdir
the trap won't necessarily have the same positional parameters.
2012-06-20 10:25:18 -04:00
Dave Reisner
542e888b48 pacstrap/arch-chroot: require root privileges to run
Suggested by Pierre. This makes sense since somewhere along the line,
pacman or mount are going to complain.
2012-06-19 08:13:52 -04:00
Dave Reisner
b60114252c pacstrap: copy the keyring into the new root 2012-06-19 08:13:06 -04:00
Dave Reisner
e5c1e4dd87 arch-chroot: use a trap to teardown the chroot 2012-06-18 16:58:25 -04:00
Dave Reisner
252a7306c1 pacstrap: set umount trap prior to calling api_mount
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.
2012-06-18 16:51:38 -04:00
Dave Reisner
60f20d8fc4 avoid fsck'ing bind mounts 2012-06-18 14:25:01 -04:00
Dave Reisner
a50ee5ee9d genfstab: treat swap devices the same as block devices
avoid using %b to unescape swap devices, the same as block devices, and
pass non-file swap devices through the write_source function.
2012-06-18 14:07:51 -04:00
Dave Reisner
8caa6c7e12 Makefile: formatting cleanup 2012-06-18 13:40:39 -04:00
Dave Reisner
120d233639 properly error on options missing an optarg 2012-06-18 11:02:40 -04:00
Dave Reisner
808f744802 genfstab: add flag to skip pseudofs mounts 2012-06-18 11:02:40 -04:00
Dave Reisner
b61c8cb366 move mangle to common, add unmangle, use in genfstab
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).
2012-06-18 10:50:52 -04:00
Pierre Schmitz
9307f3d1dd Mount /etc/resolv.conf into chroot environment
The ability to resolve DNS queries is espicially useful for arch-chroot.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-18 11:58:30 +02:00
Pierre Schmitz
6fcfe3b268 Create a project Makefile
* 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>
2012-06-18 11:17:42 +02:00
Dave Reisner
5e33ae2a9e pacstrap: add -d option to allow install to non-mount 2012-06-17 23:45:46 -04:00
Dave Reisner
ecc5942424 genfstab: deal with proper escaping/unescaping of cols
the source, target, and comments should always be mangled on writing,
and unmangled on reading.
2012-06-17 23:29:29 -04:00
Dave Reisner
8fc4708377 genfstab: handle bind mounts 2012-06-17 22:53:46 -04:00
Dave Reisner
67ec87fef0 be more verbose about chroot actions 2012-06-17 21:11:34 -04:00
Dave Reisner
1751526bc9 add proper help/usage for tools 2012-06-17 17:52:39 -04:00
Dave Reisner
2ace610c2f common: ensure the chroot point is a mountpoint 2012-06-17 17:08:27 -04:00
Dave Reisner
aa3f8471e2 add chroot helper tool 2012-06-17 16:44:55 -04:00
Dave Reisner
a00f7f33b5 genfstab: cleanup comment generation
pseudofs mounts won't have a UUID or LABEL
2012-06-17 16:35:42 -04:00
Dave Reisner
a78bbcb52a Merge git://github.com/teg/arch-install-scripts
* git://github.com/teg/arch-install-scripts:
  genfstab: make comment a bit more useful
2012-06-17 16:26:37 -04:00
Tom Gundersen
e0d81ce37c genfstab: make comment a bit more useful
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>
2012-06-17 23:27:19 +02:00
Dave Reisner
429d525480 add --noconfirm flag 2012-06-17 16:26:30 -04:00
Dave Reisner
91e63059d4 fix var substitution in dir creation 2012-06-17 16:09:18 -04:00
Dave Reisner
fc7be0ae8a fix vim modeline 2012-06-17 16:05:25 -04:00
Dave Reisner
6fc922730f fix typo in array name 2012-06-17 16:05:18 -04:00
Dave Reisner
6c42d3467c call umount as a trap handler 2012-06-17 15:28:38 -04:00
Dave Reisner
f614a4ee87 initial commit 2012-06-17 15:17:50 -04:00