Commit Graph

33 Commits

Author SHA1 Message Date
Morten Linderud
d5d3da33c7
Merge commit 'refs/pull/14/head' of github.com:archlinux/arch-install-scripts 2022-06-28 09:57:06 +02:00
Richard Hajek
2569d70d4e Added info to docs and improved readability 2022-04-25 20:16:09 +02:00
Richard Hajek
6d85a16785 Added info to arch-chroot --help 2022-04-25 20:16:09 +02:00
Sean Anderson
2623f8d76f Add unshare mode to arch-chroot
This is effectively the same transformation as in the previous patch.
We move the mountpoint warning later to avoid warning when we are about
to bind-mount the chroot dir ourselves.
2021-12-08 17:49:09 -05:00
Dave Reisner
22f5105c23 arch-chroot: squelch output from mountpoint cmd 2018-10-15 13:01:43 -04:00
Dave Reisner
85e73df200 arch-chroot: warn when chrooting into a non-mountpoint
Amend the --help to explain why this is bad.
2018-10-15 12:57:48 -04:00
Dave Reisner
e4be695f33 arch-chroot: don't require /etc/resolv.conf in the host
mansplaining emails shouldn't inspire me to fix things, but here we are.
2018-05-18 17:17:43 -04:00
Dave Reisner
cdb25e135b arch-chroot: ensure args aren't misinterpreted as chroot options 2018-02-03 09:43:51 -05:00
Dave Reisner
bd413f05ce arch-chroot: fix braino, check for args before shifting 2016-06-12 10:51:04 -04:00
jcjordyn130
50b1ba4d64 Fix the help text
Fixed the help text where it says what it will exec
2016-06-11 23:57:16 -05:00
Dave Reisner
a45f28ed81 arch-chroot: die nicely when no chroot directory is passed 2016-06-10 15:36:12 -04:00
Dave Reisner
633d192029 support coreutils chroot's --userspec 2016-04-18 07:05:15 -04:00
Dave Reisner
1b8f4b542c support chroots without an /etc/resolv.conf 2015-07-04 16:26:49 -04:00
Dave Reisner
69081c9e7e Thou shalt use /bin/bash 2015-06-30 12:46:52 -04:00
Dave Reisner
c37db2362a arch-chroot: handle /etc/resolv.conf as a symlink
This is probably going to lead to somewhere in /run, but we may as well
support a symlink to anywhere, as long as it isn't a nested symlink.

ref: https://bugs.archlinux.org/task/43540
2015-01-26 18:12:33 -05:00
Dave Reisner
e44af861eb use consistent messaging for chroot_setup failure 2014-12-16 23:15:17 -05:00
Dave Reisner
b5832066c5 rename chroot setup-related functions
make it more obvious that these are really related functions.
2014-12-15 23:23:39 -05:00
Dave Reisner
2be79c6259 run the chroot in a new PID namespace
This automatically tears down any processes remaining in the chroot
when we exit. I'm looking at you, gnupg.
2014-12-11 21:40:52 -05:00
Dave Reisner
1d35997222 common: auto-register api_fs_umount EXIT trap
This corrects some weird/wrong EXIT trap decls in arch-chroot and
pacstrap that should have been touched as part of the cleanup in
517fcff074.
2013-05-23 12:06:29 -04:00
Dave Reisner
517fcff074 chroot: do better bookkeeping of mounted devices
This was brought up when a user tried to arch-chroot into the same
root twice from different terminals. The second chroot should fail, but
not tear down the tree that it doesn't own.
2012-12-16 12:07:20 -05:00
Dave Reisner
cf84170321 add the -h option to the usage 2012-11-12 21:00:09 -05:00
Dave Reisner
debff1be89 arch-chroot: explain default behavior in usage 2012-09-08 15:29:38 -04:00
Dave Reisner
e16d57b2c2 arch-chroot: shift off first arg as chrootdir 2012-09-06 09:40:34 -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
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
Dave Reisner
05b36e029c arch-chroot: umount /etc/resolv.conf as part of trap 2012-07-15 10:09:49 -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
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
e5c1e4dd87 arch-chroot: use a trap to teardown the chroot 2012-06-18 16:58:25 -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