Compare commits
3 Commits
master
...
wip/sysroo
Author | SHA1 | Date | |
---|---|---|---|
|
db0b093076 | ||
|
8f7fc3f5d7 | ||
|
e418a17468 |
1
common
1
common
@ -88,6 +88,7 @@ chroot_setup() {
|
||||
chroot_add_mount shm "$1/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev &&
|
||||
chroot_add_mount run "$1/run" -t tmpfs -o nosuid,nodev,mode=0755 &&
|
||||
chroot_add_mount tmp "$1/tmp" -t tmpfs -o mode=1777,strictatime,nodev,nosuid
|
||||
chroot_maybe_add_mount "(( hostcache ))" /var/cache/pacman/pkg "$1/var/cache/pacman/pkg" -o bind
|
||||
}
|
||||
|
||||
chroot_teardown() {
|
||||
|
22
pacstrap.in
22
pacstrap.in
@ -76,32 +76,25 @@ shift $(( OPTIND - 1 ))
|
||||
newroot=$1; shift
|
||||
pacman_args=("${@:-base}")
|
||||
|
||||
if (( ! hostcache )); then
|
||||
pacman_args+=(--cachedir="$newroot/var/cache/pacman/pkg")
|
||||
fi
|
||||
|
||||
if (( ! interactive )); then
|
||||
pacman_args+=(--noconfirm)
|
||||
fi
|
||||
|
||||
if [[ $pacman_config ]]; then
|
||||
pacman_args+=(--config="$pacman_config")
|
||||
fi
|
||||
|
||||
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
|
||||
|
||||
# create obligatory directories
|
||||
msg 'Creating install root at %s' "$newroot"
|
||||
mkdir -m 0755 -p "$newroot"/var/{cache/pacman/pkg,lib/pacman,log} "$newroot"/{dev,run,etc}
|
||||
mkdir -m 0755 -p "$newroot"/var/{cache/pacman/pkg,lib/pacman,log} "$newroot"/{dev,run,etc/pacman.d}
|
||||
mkdir -m 1777 -p "$newroot"/tmp
|
||||
mkdir -m 0555 -p "$newroot"/{sys,proc}
|
||||
|
||||
# mount API filesystems
|
||||
chroot_setup "$newroot" || die "failed to setup chroot %s" "$newroot"
|
||||
|
||||
msg 'Installing packages to %s' "$newroot"
|
||||
if ! pacman -r "$newroot" -Sy "${pacman_args[@]}"; then
|
||||
die 'Failed to install packages to new root'
|
||||
if [[ $pacman_config ]]; then
|
||||
pacman-conf --config "$pacman_config" "$newroot/tmp/pacman.conf"
|
||||
else
|
||||
pacman-conf > "$newroot/tmp/pacman.conf"
|
||||
fi
|
||||
|
||||
if (( copykeyring )); then
|
||||
@ -116,4 +109,9 @@ if (( copymirrorlist )); then
|
||||
cp -a /etc/pacman.d/mirrorlist "$newroot/etc/pacman.d/"
|
||||
fi
|
||||
|
||||
msg 'Installing packages to %s' "$newroot"
|
||||
if ! pacman --sysroot "$newroot" --config /tmp/pacman.conf -Sy "${pacman_args[@]}"; then
|
||||
die 'Failed to install packages to new root'
|
||||
fi
|
||||
|
||||
# vim: et ts=2 sw=2 ft=sh:
|
||||
|
Loading…
Reference in New Issue
Block a user