RPi-Distro / pi-gen

Tool used to create the official Raspberry Pi OS images
BSD 3-Clause "New" or "Revised" License
2.62k stars 1.64k forks source link

Segfault when installing systemd #624

Open tazle opened 2 years ago

tazle commented 2 years ago

After working around #623 by swapping the mount and dpkg-reconfigure, I ran into another issue.

Output from docker-build.sh:

I: Configuring mount...
I: Configuring libc-bin...
I: Unpacking the base system...
W: Failure trying to run: chroot "/pi-gen/work/BT/stage0/rootfs" dpkg --force-overwrite --force-confold --skip-same-version --install /var/cache/apt/archives/adduser_3.118_all.deb /var/cache/apt/archives/dmset
up_2%3a1.02.175-2.1_armhf.deb /var/cache/apt/archives/libapparmor1_2.13.6-10_armhf.deb /var/cache/apt/archives/libargon2-1_0~20171227-0.2_armhf.deb /var/cache/apt/archives/libcap2_1%3a2.44-1_armhf.deb /var/cac
he/apt/archives/libcryptsetup12_2%3a2.3.7-1+deb11u1_armhf.deb /var/cache/apt/archives/libdevmapper1.02.1_2%3a1.02.175-2.1_armhf.deb /var/cache/apt/archives/libffi7_3.3-6_armhf.deb /var/cache/apt/archives/libgn
utls30_3.7.1-5+deb11u1_armhf.deb /var/cache/apt/archives/libhogweed6_3.7.3-1_armhf.deb /var/cache/apt/archives/libidn2-0_2.3.0-5_armhf.deb /var/cache/apt/archives/libip4tc2_1.8.7-1_armhf.deb /var/cache/apt/arc
hives/libjson-c5_0.15-2_armhf.deb /var/cache/apt/archives/libkmod2_28-1_armhf.deb /var/cache/apt/archives/libnettle8_3.7.3-1_armhf.deb /var/cache/apt/archives/libp11-kit0_0.23.22-1_armhf.deb /var/cache/apt/arc
hives/libseccomp2_2.5.1-1+rpi1+deb11u1_armhf.deb /var/cache/apt/archives/libtasn1-6_4.16.0-2_armhf.deb /var/cache/apt/archives/libunistring2_0.9.10-4_armhf.deb /var/cache/apt/archives/systemd_247.3-7+rpi1_armh
f.deb
W: See /pi-gen/work/BT/stage0/rootfs/debootstrap/debootstrap.log for details (possibly the package /var/cache/apt/archives/dpkg_1.20.11+rpi1_armhf.deb is at fault)

Tail of /pi-gen/work/BT/stage0/rootfs/debootstrap/debootstrap.log in the container:

Setting up libcryptsetup12:armhf (2:2.3.7-1+deb11u1) ...
Setting up systemd (247.3-7+rpi1) ...
Created symlink /etc/systemd/system/getty.target.wants/getty@tty1.service -> /lib/systemd/system/getty@.service.
Created symlink /etc/systemd/system/multi-user.target.wants/remote-fs.target -> /lib/systemd/system/remote-fs.target.
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-pstore.service -> /lib/systemd/system/systemd-pstore.service.
Initializing machine ID from random generator.
Segmentation fault (core dumped)
dpkg: error processing package systemd (--install):
 installed systemd package post-installation script subprocess returned error exit status 139
Processing triggers for libc-bin (2.31-13+rpi1+deb11u3) ...
Errors were encountered while processing:
 systemd

I have't yet looked deeper into what goes wrong.

XECDesign commented 2 years ago

If I recall correctly, it's an issue with using an old version of qemu. Last time I looked at qemu, there were no released versions that worked. Each one had a different set of issues which made it unusable for pi-gen, so I've been recommending people only do native builds for now.

The issues I've reported have been fixed, but I haven't checked if those fixes have made it into a release without introducing new issues yet.