You are not logged in.
Pages: 1
I have this makefile which installs a new systemd-nspawn container:
MACHINES_DIR=/var/lib/machines
CONT_NAME=generic-arch
all:
echo "nothing to build, just 'make install'"
install:
mkdir -p $(DESTDIR)$(MACHINES_DIR)/$(CONT_NAME)
pacstrap -K -c $(DESTDIR)$(MACHINES_DIR)/$(CONT_NAME) base
install -D -m644 generic-arch.nspawn $(DESTDIR)/etc/systemd/nspawn/$(CONT_NAME).nspawn
cat init.sh | systemd-nspawn -P -D $(DESTDIR)$(MACHINES_DIR)/$(CONT_NAME)init.sh:
#! /bin/bash
LC_ALL=C tr -dc '[:graph:]' </dev/urandom | head -c 16 | passwd -s
systemctl enable systemd-networkd
systemctl enable systemd-resolvedgeneric-arch.nspawn:
[Exec]
PrivateUsers=managed
ResolvConf=bind-static
[Network]
Bridge=br0I created a PKGBUILD for that setup:
pkgname="msl-base-arch"
pkgver=r3.a235591
pkgrel=1
pkgdesc="Base arch container"
arch=(any)
url=""
license=('unknown')
groups=()
depends=('systemd' 'bash')
makedepends=('git' 'arch-install-scripts' 'pacman' 'fakeroot' 'systemd')
provides=("${pkgname}")
conflicts=("${pkgname}")
replaces=()
backup=()
options=()
install=
source=("${srcdir}/${pkgname}::git://generic-arch/msl-gen-cont.git")
noextract=()
sha256sums=('SKIP')
pkgver() {
cd "${srcdir}/${pkgname}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}/${pkgname}"
rename generic-arch base-arch *
sed -i 's/generic-arch/base-arch/g' *
sed -i 's/br0/msl-util-br/g' *
}
package() {
cd "${srcdir}/${pkgname}"
make DESTDIR="$pkgdir" install
}When I run makepkg, I get the following:
==> Making package: msl-base-arch r2.0eddcf5-1 (Mon Apr 13 22:25:34 2026)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating /msl-base-arch git repo...
==> Validating source files with sha256sums...
/msl-base-arch ... Skipped
==> Extracting sources...
-> Creating working copy of /msl-base-arch git repo...
Reset branch 'makepkg'
==> Starting prepare()...
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
mkdir -p /home/maesli/projects/msl-base-arch/pkg/msl-base-arch/var/lib/machines/base-arch
pacstrap -K -c /home/maesli/projects/msl-base-arch/pkg/msl-base-arch/var/lib/machines/base-arch base
==> Creating install root at /home/maesli/projects/msl-base-arch/pkg/msl-base-arch/var/lib/machines/base-arch
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
mount: /home/maesli/projects/msl-base-arch/pkg/msl-base-arch/var/lib/machines/base-arch/proc: must be superuser to use mount.
dmesg(1) may have more information after failed mount system call.
==> ERROR: failed to setup chroot /home/maesli/projects/msl-base-arch/pkg/msl-base-arch/var/lib/machines/base-arch
make: *** [makefile:9: install] Error 1
==> ERROR: A failure occurred in package().
Aborting...I get the same error when running
makechrootpkg -c -x failure -r $CHROOTWhen I add sudo before pacstrap, makepkg prompts me my own password and fails at the fourth line of make install, while makechrootpkg prompts for builduser's password.
Why does pacstrap require root privileges in fakeroot? What am I missing here?
Offline
Does "pacstrap -N -…" work?
Offline
Pages: 1