diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | common | 33 | ||||
| -rw-r--r-- | completion/pacstrap.bash | 2 | ||||
| -rw-r--r-- | doc/pacstrap.8.asciidoc | 3 | ||||
| -rw-r--r-- | pacstrap.in | 15 |
5 files changed, 45 insertions, 10 deletions
@@ -1,4 +1,4 @@ -VER=24 +VER=26 PREFIX = /usr/local @@ -1,9 +1,11 @@ # generated from util-linux source: libmount/src/utils.c declare -A pseudofs_types=([anon_inodefs]=1 + [apparmorfs]=1 [autofs]=1 [bdev]=1 - [bpf]=1 + [binder]=1 [binfmt_misc]=1 + [bpf]=1 [cgroup]=1 [cgroup2]=1 [configfs]=1 @@ -13,33 +15,56 @@ declare -A pseudofs_types=([anon_inodefs]=1 [devpts]=1 [devtmpfs]=1 [dlmfs]=1 + [dmabuf]=1 + [drm]=1 [efivarfs]=1 + [fuse]=1 + [fuse.archivemount]=1 + [fuse.avfsd]=1 + [fuse.dumpfs]=1 + [fuse.encfs]=1 [fuse.gvfs-fuse-daemon]=1 + [fuse.gvfsd-fuse]=1 + [fuse.lxcfs]=1 + [fuse.rofiles-fuse]=1 + [fuse.vmware-vmblock]=1 + [fuse.xwmfs]=1 [fusectl]=1 [hugetlbfs]=1 + [ipathfs]=1 [mqueue]=1 [nfsd]=1 [none]=1 + [nsfs]=1 + [overlay]=1 [pipefs]=1 [proc]=1 [pstore]=1 [ramfs]=1 + [resctrl]=1 [rootfs]=1 [rpc_pipefs]=1 [securityfs]=1 + [selinuxfs]=1 + [smackfs]=1 [sockfs]=1 [spufs]=1 [sysfs]=1 - [tmpfs]=1) + [tmpfs]=1 + [tracefs]=1 + [vboxsf]=1 + [virtiofs]=1) # generated from: pkgfile -vbr '/fsck\..+' | awk -F. '{ print $NF }' | sort -declare -A fsck_types=([cramfs]=1 +declare -A fsck_types=([btrfs]=1 + [cramfs]=1 + [erofs]=1 [exfat]=1 [ext2]=1 [ext3]=1 [ext4]=1 - [ext4dev]=1 [f2fs]=1 + [fat]=1 [jfs]=1 [minix]=1 [msdos]=1 diff --git a/completion/pacstrap.bash b/completion/pacstrap.bash index a77cb04..25d2211 100644 --- a/completion/pacstrap.bash +++ b/completion/pacstrap.bash @@ -8,7 +8,7 @@ _pacstrap() { COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - opts="-C -c -G -i -M -N -h" + opts="-C -c -G -i -K -M -N -h" for i in "${COMP_WORDS[@]:1:COMP_CWORD-1}"; do if [[ -d ${i} ]]; then diff --git a/doc/pacstrap.8.asciidoc b/doc/pacstrap.8.asciidoc index 6eed23e..3b76aa9 100644 --- a/doc/pacstrap.8.asciidoc +++ b/doc/pacstrap.8.asciidoc @@ -34,6 +34,9 @@ Options *-i*:: Prompt for package confirmation when needed (run interactively). +*-K*:: + Initialize an empty pacman keyring in the target (implies '-G'). + *-M*:: Avoid copying the host's mirrorlist to the target. diff --git a/pacstrap.in b/pacstrap.in index b1cfb09..0e25ef8 100644 --- a/pacstrap.in +++ b/pacstrap.in @@ -14,6 +14,7 @@ m4_include(common) hostcache=0 copykeyring=1 +initkeyring=0 copymirrorlist=1 pacmode=-Sy setup=chroot_setup @@ -28,6 +29,7 @@ usage: ${0##*/} [options] root [packages...] -c Use the package cache on the host, rather than the target -G Avoid copying the host's pacman keyring to the target -i Prompt for package confirmation when needed (run interactively) + -K Initialize an empty pacman keyring in the target (implies '-G') -M Avoid copying the host's mirrorlist to the target -N Run in unshare mode as a regular user -U Use pacman -U to install packages @@ -45,7 +47,7 @@ if [[ -z $1 || $1 = @(-h|--help) ]]; then exit $(( $# ? 0 : 1 )) fi -while getopts ':C:cdGiMNU' flag; do +while getopts ':C:cdGiKMNU' flag; do case $flag in C) pacman_config=$OPTARG @@ -62,6 +64,9 @@ while getopts ':C:cdGiMNU' flag; do G) copykeyring=0 ;; + K) + initkeyring=1 + ;; M) copymirrorlist=0 ;; @@ -112,9 +117,11 @@ pacstrap() { # mount API filesystems $setup "$newroot" || die "failed to setup chroot %s" "$newroot" - if (( copykeyring )); then - # if there's a keyring on the host, copy it into the new root, unless it exists already - if [[ -d /etc/pacman.d/gnupg && ! -d $newroot/etc/pacman.d/gnupg ]]; then + if [[ ! -d $newroot/etc/pacman.d/gnupg ]]; then + if (( initkeyring )); then + pacman-key --gpgdir "$newroot"/etc/pacman.d/gnupg --init + elif (( copykeyring )) && [[ -d /etc/pacman.d/gnupg ]]; then + # if there's a keyring on the host, copy it into the new root cp -a --no-preserve=ownership /etc/pacman.d/gnupg "$newroot/etc/pacman.d/" fi fi |
