Commit Graph

58 Commits

Author SHA1 Message Date
Dave Reisner
9888ce06e1 prepare v6 release 2012-09-06 09:56:51 -04:00
Dave Reisner
e16d57b2c2 arch-chroot: shift off first arg as chrootdir 2012-09-06 09:40:34 -04:00
Dave Reisner
09772d0f38 genfstab: use a more innocuous name than 'source' 2012-08-08 23:15:57 -04:00
Dave Reisner
c8b3d5e8d8 genfstab: handle btrfs subvolumes correctly 2012-08-08 23:12:27 -04:00
Dave Reisner
4c6dd31924 prepare v5 2012-08-03 19:59:27 -04:00
Pierre Schmitz
d571cb4ec4 arch-chroot: Default to /bin/bash as shell
By default chroot uses SHELL as default shell on the target if not specified otherwise.
As our install iso uses zsh this might fail if zsh is not installed on the target.

[dave: changed shell to /bin/sh]
2012-08-03 19:48:08 -04:00
Dave Reisner
71a4471d25 Revert "arch-chroot: default to /bin/sh when no command given"
This doesn't actually work since we don't shift off the chroot
directory.

This reverts commit 67c4b0fd24.
2012-08-03 19:47:26 -04:00
Dave Reisner
40fcfbf1a9 prepare v4 2012-08-03 19:11:31 -04:00
Dave Reisner
67c4b0fd24 arch-chroot: default to /bin/sh when no command given
chroot(1) will default to ${SHELL:-/bin/sh} which might not work, given
SHELL being /bin/zsh instead. Immediately default to /bin/sh, which will
exist in any sane chroot.
2012-08-03 19:07:03 -04:00
Daniel Wallace
d195e48981 allow turning off --noconfirm
use -i (interactive) to allow for choosing packages from groups

[dave: alter option description]
2012-08-03 08:43:01 -04:00
Dave Reisner
93b3298147 prepare v3
What happened to v2? I HAVE NO IDEA.
2012-07-24 20:43:48 -04:00
Daniel Wallace
38e446d995 Add zsh completion for all scripts 2012-07-22 23:28:59 -04:00
Dave Reisner
2dda000a86 genfstab: avoid mangling root parameter 2012-07-22 20:16:09 -04:00
Dave Reisner
b7c75786b0 genfstab: avoid reference to uninitialized var
Rename this, too, so it doesn't share a name with a reserved word.

Fixes FS#30808
2012-07-22 20:11:54 -04:00
Dave Reisner
ced04ef0f9 pacstrap: create package cache along with DBPath
pacman creates this for us, but seems to have problems writing to it.

Hackily addresses FS#30807
2012-07-22 20:10:47 -04:00
Dave Reisner
05b36e029c arch-chroot: umount /etc/resolv.conf as part of trap 2012-07-15 10:09:49 -04:00
Dave Reisner
f83a267672 make the 'all' target a dependency of 'install' 2012-07-15 10:07:39 -04:00
Dave Reisner
1d9c98c5ee enforce user-specified root directory
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.
2012-07-15 10:07:11 -04:00
Dave Reisner
de68d4cc02 reverse default and set values for hostcache option 2012-07-14 09:33:46 -04:00
Dave Reisner
694742e484 prepare v1 release 2012-07-14 08:07:00 -04:00
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