Commit Graph

167 Commits

Author SHA1 Message Date
Eli Schwartz
da67c1906f
doc: add manpages for all programs 2019-06-05 15:44:58 -04:00
Eli Schwartz
aeab95dbab
doc: add manpage infrastructure 2019-06-05 15:37:53 -04:00
Eli Schwartz
8652c5a724
consistently use -v <val> for help text descriptions 2019-06-05 15:26:59 -04:00
Eli Schwartz
53debcefab
pacstrap: try to copy the host keyring before installing packages
When there is no keyring in the new root, attempting to install e.g.
archlinux-keyring will result in the post-install script silently
failing to do anything (because there are no keys, and, critically, no
secret keys). The potentially very outdated keyring is then copied over
from the host, secret key and all, so subsequent pacman operations have
a trusted keyring that is at least as recent as the ISO or other host
system... but if there has been a keyring update between the date of the
ISO creation and the date of the install, those keys will continue to be
missing until the next keyring update, resulting in a bad out-of-the-box
experience.

This also means that if a thirdparty keyring package was scheduled to be
installed, it will not be populated at all; this affects downstream
archlinux32 build chroots.

There's no reason to delay this until after packages are installed -- we
aren't afraid of e.g. the mirrorlist resulting in file conflicts due to
a packaged pacman-mirrorlist, because the gnupg configuration should not
be getting packaged directly.

Fixes FS#61296 FS#61304 FS#61309 FS#61312 FS#62355
2019-05-21 01:32:52 -04:00
Dave Reisner
d5fe3b7bdb prepare v21 2019-01-05 11:25:50 -05:00
Dave Reisner
1f6e69f03e Clarify that -i means run interactively
ref: https://bugs.archlinux.org/task/60096
2019-01-05 11:21:09 -05:00
Dave Reisner
dad0ee7266 Only use explicitly set swap priorities
A priority of -2 seems to indicate "not defined" and we should simply
leave this alone.
2019-01-05 11:21:09 -05:00
Dave Reisner
aea51ba901 Bind mount /run from host into new root
ref: https://bugs.archlinux.org/task/61040
2019-01-05 11:21:06 -05:00
Dave Reisner
e7add12aba Add more pseudofs types 2018-12-11 07:25:20 -05:00
Dave Reisner
60961e397e prepare v20 2018-10-16 13:00:35 -04:00
Dave Reisner
22f5105c23 arch-chroot: squelch output from mountpoint cmd 2018-10-15 13:01:43 -04:00
Dave Reisner
c07baac985 genfstab: give examples of valid values for -t
This is non-exhaustive, but it's representative of the popular options
in 2018.
2018-10-15 12:58:46 -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
c568e9059c common: avoid calling umount without any args
For example, when calling arch-chroot on a dir without a /proc:

  # arch-chroot badroot
  mount: badroot/proc: mount point does not exist.
  ==> ERROR: failed to setup chroot badroot
  umount: bad usage
  Try 'umount --help' for more information.
2018-10-06 19:58:05 -04:00
Dave Reisner
0c7d9e570f Rephrase description of -i to be less awful 2018-09-17 17:40:19 -04:00
Dave Reisner
e032d48eba prepare v19 2018-08-25 06:57:13 -04:00
Dave Reisner
173d95d964 drop dist and uninstall targets
I'm too lazy to maintain an uninstall target for something that should
be distributed as a package, and the dist target can just be replaced
by git clones. No more tarballs!
2018-08-25 06:56:05 -04:00
Dave Reisner
4b929ea03a genfstab: add support for prefix matching
this allows genfstab to used on running systems to generate entries for
newly added mount points.
2018-05-18 17:18:03 -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
dcd308f373 prepare v18 2018-01-27 07:19:50 -05:00
Dave Reisner
0af6884aca pacstrap: retire -d flag
Similar to 232784ec, this logic has been around forever with no
discernible value. Retire the flag from the code and documentation, but
leave it behind as a vestige in order to not break scripts found in the
wild.
2018-01-27 07:17:30 -05:00
Dave Reisner
232784ec56 Don't bind mount non-mountpoint directory on itself
This essentially reverts 2ace610c. I'm forgetting the historical context
of what lead to that commit (but note that it predates the first tag).
The only thing I can think of is that genfstab doesn't produce the
correct output when root isn't a mountpoint, but that's a crap reason --
you won't need an fstab when you're calling pacstrap on a directory and
genfstab already complains when the provided root isn't a mountpoint.
2017-11-05 10:14:50 -05:00
Dave Reisner
6c0696b3d4 common: empty initialize rather than mangling environment
Instead of mangling the caller's environment, just scope our hexchars
and reinitialize them.
2017-08-20 16:37:04 -04:00
Dave Reisner
0b8efa0e42 common: add cgroup2 as a pseudofs 2017-06-29 08:23:30 -04:00
Dave Reisner
4b781af21f prune relatime option for psuedofs 2017-06-29 08:23:30 -04:00
Dave Reisner
341c8d66ad prepare v17 2016-06-12 12:18:36 -04:00
Dave Reisner
9742606666 README: document dependency requirements
Yes, you really do need a userspace released some time in the past 3
years to install Arch.
2016-06-12 10:53:13 -04:00
Dave Reisner
bd413f05ce arch-chroot: fix braino, check for args before shifting 2016-06-12 10:51:04 -04:00
Dave Reisner
daa2fac5b2 genfstab: canonicalize root dir
Avoids problems with users passing weird inputs (such as including a
trailing slash).

ref: https://bugs.archlinux.org/task/45753
2016-06-12 10:48:26 -04:00
Dave Reisner
585b1f790f Merge pull request #27 from jcjordyn130/patch-1
Fix the help text
2016-06-12 08:48:58 -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
cb83a4d3dc prepare v16 2016-06-11 13:11:06 -04: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
42ea087f2d prepare v15 2015-02-15 14:58:32 -05: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
ae6a0a00ec genfstab: strip seclabel from optstring
People seem to suffer from this, so let's just fix it.

https://www.marshut.net/krqsrn/genfstab-fstab-seclabel-uuid-vs-partuuid-and-arch-wiki.html
https://bbs.archlinux.org/viewtopic.php?pid=1360580
2014-12-26 12:04:05 -05:00
Dave Reisner
67dcb08f4b genfstab: make -p default behavior, add -P as inverse
This should be the default, as you generally don't want to include
pseudofs mounts in your /etc/fstab.
2014-12-26 11:54:24 -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
e0eaca918e fix valid_number_of_base
function execution halts entirely on a invalid base, so we never
actually get to our 'return 1'. I'm not sure how our expected failures
ever actually worked, but it's quite plain to see that:

  $ a=$(( 2#3 )); echo hi

Never echos "hi". Use a subshell in valid_number_of_base so that we can
properly "trap" execution, and return a meaningful result.
2014-12-15 13:40:00 -05:00
Dave Reisner
25c058a2a2 explicitly exit from TEST_exit
This prevents some odd interactions with the EXIT trap, and our last
command's status is seemingly not preserved for the script's real exit.

Add a BASH override to the Makefile as well, as it might be useful for
debugging or testing against other versions of bash.
2014-12-15 08:38:43 -05:00
Dave Reisner
7b4cf9a637 prepare v14 2014-12-12 18:43:21 -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
02062d2bd6 Merge pull request #21 from abraithwaite/patch-1
Remove redundant variable declaration
2014-10-30 18:07:47 -04:00
Alan Braithwaite
a54860044f Remove redundant variable declaration
Unless I'm mistaken, newroot is assigned later, and never referenced in between:
```
(( $# )) || die "No root directory specified"
newroot=$1; shift
```
2014-10-30 14:19:48 -07:00
Dave Reisner
f726f8c22c genfstab: add vfat quirk 2014-04-06 10:48:15 -04:00