Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi: Disable merged-usr of debootstrap #728

Closed
wants to merge 1 commit into from

Conversation

ryonakano
Copy link
Member

Fixes #727

base-files on noble or later contains symlink to /bin, /lib, /lib64, and /sbin as you can see at https://packages.ubuntu.com/en/noble/arm64/base-files/filelist

However, because debootstrap already setup these symlinks, extracting base-files fails with the following error:

I: Extracting base-files...
E: Tried to extract package, but file already exists. Exit...

(See also https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/2054925)

This commit prevent debootstrap from setting up symlinks and let base-files do that job instead.

base-files on noble or later contains symlink to /bin, /lib, /lib64, and /sbin
as you can see at https://packages.ubuntu.com/en/noble/arm64/base-files/filelist

However, because debootstrap already setup these symlinks, extracting base-files
fails with the following error:

    I: Extracting base-files...
    E: Tried to extract package, but file already exists. Exit...

(See also https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/2054925)

This commit prevent debootstrap from setting up symlinks and let
base-files do that job instead.
@ryonakano
Copy link
Member Author

Confirmed the build script generates image on OS 8 RC natively. The script fails because python3-distutils couldn't be found, but it's for uploading the image, which would fails eventually if we run locally.

Rsyncing rootfs into image file
del devmap : loop0p1
del devmap : loop0p2
Compressing elementaryos-8.0-daily-rpi-20241103.img
0e8c6c8af8ba5c767c3592ec59b8e8ee  elementaryos-8.0-daily-rpi-20241103.img.xz
03ddc41c89ef05056fd3efa40f785fc97b4110b3bc5bafa45ab3dad8b9164cce  elementaryos-8.0-daily-rpi-20241103.img.xz
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3-distutils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-distutils' has no installation candidate
user@VirtualBox-c0504e30:~/work/os$ ls artifacts/elementary-rpi/elementaryos-8.0-daily-rpi-20241103.img.xz 
artifacts/elementary-rpi/elementaryos-8.0-daily-rpi-20241103.img.xz
user@VirtualBox-c0504e30:~/work/os$ file artifacts/elementary-rpi/elementaryos-8.0-daily-rpi-20241103.img.xz 
artifacts/elementary-rpi/elementaryos-8.0-daily-rpi-20241103.img.xz: XZ compressed data, checksum CRC64
user@VirtualBox-c0504e30:~/work/os$ 

Building on Docker as written in README fails but I believe this is not caused by this PR.

W: Failure trying to run:  dpkg --force-overwrite --force-confold --skip-same-version --install /var/cache/apt/archives/libapparmor1_4.0.0-beta3-0ubuntu3_arm64.deb /var/cache/apt/archives/libargon2-1_0~20190702+dfsg-4build1_arm64.deb /var/cache/apt/archives/libcryptsetup12_2%3a2.7.0-1ubuntu4_arm64.deb /var/cache/apt/archives/libdevmapper1.02.1_2%3a1.02.185-3ubuntu3_arm64.deb /var/cache/apt/archives/libfdisk1_2.39.3-9ubuntu6_arm64.deb /var/cache/apt/archives/libjson-c5_0.17-1build1_arm64.deb /var/cache/apt/archives/libkmod2_31+20240202-2ubuntu7_arm64.deb /var/cache/apt/archives/libseccomp2_2.5.5-1ubuntu3_arm64.deb /var/cache/apt/archives/libsystemd-shared_255.4-1ubuntu8_arm64.deb /var/cache/apt/archives/systemd_255.4-1ubuntu8_arm64.deb /var/cache/apt/archives/systemd-dev_255.4-1ubuntu8_all.deb
W: See //debootstrap/debootstrap.log for details (possibly the package systemd is at fault)
[ryo@b760m ~/work/elementary/os (ryonakano/rpi-fix-build %)]$ tail -n20 artifacts/elementary-rpi/elementary-arm64/debootstrap/debootstrap.log
Setting up systemd (255.4-1ubuntu8) ...
Created symlink /etc/systemd/system/getty.target.wants/getty@tty1.service -> /usr/lib/systemd/system/getty@.service.
Created symlink /etc/systemd/system/multi-user.target.wants/remote-fs.target -> /usr/lib/systemd/system/remote-fs.target.
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-pstore.service -> /usr/lib/systemd/system/systemd-pstore.service.
Initializing machine ID from random generator.
/usr/lib/tmpfiles.d/systemd-network.conf:10: Failed to resolve user 'systemd-network': No such process
/usr/lib/tmpfiles.d/systemd-network.conf:11: Failed to resolve user 'systemd-network': No such process
/usr/lib/tmpfiles.d/systemd-network.conf:12: Failed to resolve user 'systemd-network': No such process
/usr/lib/tmpfiles.d/systemd-network.conf:13: Failed to resolve user 'systemd-network': No such process
/usr/lib/tmpfiles.d/systemd.conf:22: Failed to resolve group 'systemd-journal': No such process
/usr/lib/tmpfiles.d/systemd.conf:23: Failed to resolve group 'systemd-journal': No such process
/usr/lib/tmpfiles.d/systemd.conf:28: Failed to resolve group 'systemd-journal': No such process
/usr/lib/tmpfiles.d/systemd.conf:29: Failed to resolve group 'systemd-journal': No such process
/usr/lib/tmpfiles.d/systemd.conf:30: Failed to resolve group 'systemd-journal': No such process
Failed to take /etc/passwd lock: Invalid argument
dpkg: error processing package systemd (--install):
 installed systemd package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.39-0ubuntu8) ...
Errors were encountered while processing:
 systemd
[ryo@b760m ~/work/elementary/os (ryonakano/rpi-fix-build %)]$

@ryonakano ryonakano mentioned this pull request Nov 3, 2024
@stsdc
Copy link
Member

stsdc commented Nov 3, 2024

Docker builds for me.

@ryonakano
Copy link
Member Author

@stsdc Did you mean the above error didn't occur?

@stsdc
Copy link
Member

stsdc commented Nov 3, 2024

@ryonakano I removed artifacts and started build using docker. The build was successful. Of course I got a Python error, because it couldn't upload.

docker run --rm --privileged -it -v /proc:/proc -v ${PWD}:/working_dir -w /working_dir ubuntu:22.04 ./build-rpi.sh

When I run it again I got:

I: Validating zlib1g 1:1.3.dfsg-3.1ubuntu2
I: Chosen extractor for .deb packages: dpkg-deb
I: Extracting base-files...
E: Tried to extract package, but file already exists. Exit...

and

stsdc@desktop:~/projects/os$ tail -n15 artifacts/elementary-rpi/elementary-arm64/debootstrap/debootstrap.log
tar: ./usr/share/pixmaps/ubuntu-logo-text-dark.png: Cannot open: File exists
tar: ./usr/share/pixmaps/ubuntu-logo-text.png: Cannot open: File exists
tar: ./usr/share/pixmaps/ubuntu-logo.svg: Cannot open: File exists
tar: ./usr/share/profile: Cannot open: File exists
tar: ./usr/share/profile.md5sums: Cannot open: File exists
tar: ./usr/share/staff-group-for-usr-local: Cannot open: File exists
tar: ./bin: Cannot create symlink to 'usr/bin': File exists
tar: ./etc/os-release: Cannot open: File exists
tar: ./lib: Cannot create symlink to 'usr/lib': File exists
tar: ./sbin: Cannot create symlink to 'usr/sbin': File exists
tar: ./usr/share/common-licenses/GFDL: Cannot create symlink to 'GFDL-1.3': File exists
tar: ./usr/share/common-licenses/GPL: Cannot create symlink to 'GPL-3': File exists
tar: ./usr/share/common-licenses/LGPL: Cannot create symlink to 'LGPL-3': File exists
tar: ./usr/share/doc/base-files/FAQ: Cannot create symlink to 'README': File exists
tar: Exiting with failure status due to previous errors

I don't know if this is expected or not.

@ryonakano
Copy link
Member Author

@ryonakano I removed artifacts and started build using docker. The build was successful. Of course I got a Python error, because it couldn't upload.

Thank you for your info. The Docker build didn't succeed for me at all but I'm using Fedora 39 as a host OS of Docker, not elementary OS, so that might cause my problem. 😞

I don't know if this is expected or not.

I think this is because the current build-rpi.sh and build-pinebook.sh is just for intended for CI, and running locally is not expected. I'll work on supporting running these scripts locally in another PR, i.e. cleaning up artifacts before build process and separate upload process into another script. After that the above error shouldn't occur.

@ryonakano ryonakano deleted the ryonakano/rpi-fix-build branch November 4, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raspberry Pi build fails
2 participants