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

Get rid of debootstrap #2602

Merged
merged 4 commits into from
Aug 3, 2024
Merged

Get rid of debootstrap #2602

merged 4 commits into from
Aug 3, 2024

Conversation

schaefi
Copy link
Collaborator

@schaefi schaefi commented Jul 30, 2024

Replace debootstrap with an apt-get based pre-download of packages followed by a dpkg-deb extraction.
This Fixes #2599

@schaefi schaefi requested a review from Conan-Kudo July 30, 2024 13:35
@schaefi schaefi self-assigned this Jul 30, 2024
@schaefi
Copy link
Collaborator Author

schaefi commented Jul 30, 2024

@Conan-Kudo I'm unsure about the usr-merge stuff and did not yet add that. Is this manual usrmerge really needed ? Maybe @DaanDeMeyer could provide a hint ?

Thanks

@Conan-Kudo
Copy link
Member

Note this has the consequence of breaking Debian builds on openSUSE hosts since apt is not available there.

@Conan-Kudo
Copy link
Member

@Conan-Kudo I'm unsure about the usr-merge stuff and did not yet add that. Is this manual usrmerge really needed ? Maybe @DaanDeMeyer could provide a hint ?

We do need it as that package is what forces usrmerge for Debian systems.

@DaanDeMeyer
Copy link

Note that what mkosi does might be too extreme, I don't think all the per architecture symlinks are actually required, I just never bothered with dropping them again.

@schaefi
Copy link
Collaborator Author

schaefi commented Jul 30, 2024

Note this has the consequence of breaking Debian builds on openSUSE hosts since apt is not available there.

I think that never worked because if you call apt-get on suse you get

apt-get --version
zypper 1.14.59

How funny, so I don't care.

@schaefi
Copy link
Collaborator Author

schaefi commented Jul 30, 2024

Note that what mkosi does might be too extreme, I don't think all the per architecture symlinks are actually required, I just never bothered with dropping them again.

yeah I also thought it might be too drastic :) I think in the kiwi case we try first without it and see where it causes issues and if it does try to find a solution...

@schaefi
Copy link
Collaborator Author

schaefi commented Jul 30, 2024

I set the don't merge label as I want to create a Staging build and see if our debian integration tests still builds

@Conan-Kudo
Copy link
Member

Note that what mkosi does might be too extreme, I don't think all the per architecture symlinks are actually required, I just never bothered with dropping them again.

yeah I also thought it might be too drastic :) I think in the kiwi case we try first without it and see where it causes issues and if it does try to find a solution...

Do we have debian tests on all arches?

@schaefi
Copy link
Collaborator Author

schaefi commented Jul 30, 2024

we have

  • Testing_arm:ubuntu/
  • Testing_x86:ubuntu
  • Testing_x86:debian

no power no s390

@Conan-Kudo
Copy link
Member

That's probably fine for this...

@Conan-Kudo
Copy link
Member

Do we tell apt to disable signature checking? Because if we don't, it probably isn't going to work.

@schaefi schaefi force-pushed the get_rid_of_debootstrap branch 2 times, most recently from e67c6fb to acaa8bb Compare July 31, 2024 15:17
@schaefi
Copy link
Collaborator Author

schaefi commented Jul 31, 2024

@Conan-Kudo @DaanDeMeyer ok I found why it does not work on an obs worker. So look at this

[   42s] [ DEBUG   ]: 15:16:49 | EXEC: [apt-get -q -c /usr/src/packages/KIWI-oem/build/image-root/kiwi_apt.conf -y --no-install-recomm
ends install -oDebug::pkgDPkgPm=1 -oDPkg::Pre-Install-Pkgs::=cat >/var/tmp/kiwi_debs_2dq76tkw ?essential ?exact-name(usr-is-merged) ap
t]
[   42s] [ DEBUG   ]: 15:16:49 | Apt download: Reading package lists...
[   42s] Building dependency tree...
[   42s] apt is already the newest version (2.6.1).
[   42s] base-files is already the newest version (12.4+deb12u6).
[   42s] dpkg is already the newest version (1.21.22).
[   42s] base-passwd is already the newest version (3.6.1).
[   42s] bash is already the newest version (5.2.15-2+b7).
[   42s] debianutils is already the newest version (5.7-0.5~deb12u1).
[   42s] bsdutils is already the newest version (1:2.38.1-5+deb12u1).
[   42s] coreutils is already the newest version (9.1-1).
[   42s] dash is already the newest version (0.5.12-2).
[   42s] init-system-helpers is already the newest version (1.65.2).
[   42s] diffutils is already the newest version (1:3.8-4).
[   42s] tar is already the newest version (1.34+dfsg-1.2+deb12u1).
[   42s] findutils is already the newest version (4.9.0-4).
[   42s] grep is already the newest version (3.8-5).
[   42s] gzip is already the newest version (1.12-1).
[   42s] hostname is already the newest version (3.23+nmu1).
[   42s] libc-bin is already the newest version (2.36-9+deb12u7).
[   42s] perl-base is already the newest version (5.36.0-7+deb12u1).
[   42s] login is already the newest version (1:4.13+dfsg1-1+b1).
[   42s] ncurses-base is already the newest version (6.4-4).
[   42s] ncurses-bin is already the newest version (6.4-4).
[   42s] sed is already the newest version (4.9-1).
[   42s] sysvinit-utils is already the newest version (3.06-4).
[   42s] util-linux is already the newest version (2.38.1-5+deb12u1).
[   42s] The following NEW packages will be installed:
[   42s]   usr-is-merged
[   42s] 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
[   42s] Need to get 0 B/5616 B of archives.
[   42s] After this operation, 13.3 kB of additional disk space will be used.

This is funny. On the worker itself the packages that we want for bootstrap are already installed. This leads to a number of is already the newest version and apt does not download them. Resulting in a Pre-Install-Pkgs list that consists out of one entry :) From that one entry we unpack it into the new root tree and of course that is by far not enough :)

So can the download be forced even if the system already has that package installed ?

Thanks much

@DaanDeMeyer
Copy link

Add --reinstall?

@Conan-Kudo
Copy link
Member

That means it's using the host dpkg status file, is there a way to make apt not do that?

@DaanDeMeyer
Copy link

Sure apt has options for everything, should be somewhere in the man pages

@schaefi
Copy link
Collaborator Author

schaefi commented Aug 2, 2024

Dir::State::status solved it

@schaefi schaefi force-pushed the get_rid_of_debootstrap branch 3 times, most recently from f563796 to d7b1689 Compare August 2, 2024 15:12
@schaefi
Copy link
Collaborator Author

schaefi commented Aug 2, 2024

kiwi/repository/template/apt.py Show resolved Hide resolved
package/python-kiwi-spec-template Show resolved Hide resolved
package/python-kiwi-spec-template Outdated Show resolved Hide resolved
package/python-kiwi-spec-template Show resolved Hide resolved
Replace debootstrap with an apt-get based pre-download of
packages followed by a dpkg-deb extraction.
This Fixes #2599
@schaefi schaefi force-pushed the get_rid_of_debootstrap branch 2 times, most recently from 0a71797 to eae4762 Compare August 2, 2024 20:28
@schaefi
Copy link
Collaborator Author

schaefi commented Aug 2, 2024

The ubuntu integration needs some adaptions such that apt-get after bootstrap succeeds. This is now done. The integration tests for x86_64 and aarch64 succeeds here:

@schaefi schaefi force-pushed the get_rid_of_debootstrap branch 2 times, most recently from 8a8fa13 to 320e810 Compare August 3, 2024 19:30
@schaefi
Copy link
Collaborator Author

schaefi commented Aug 3, 2024

<package name="libpam-runtime"/>

was needed to fix the pam issue. Its script code has to run such that we have to install this package in the proper system installation because just unpacking it in the bootstrap is not enough and it is not picked up by the dependency solver later. Thus needs to be explicitly added to the package list and that made the OS to function properly

Remove package hacks for debootstrap, explicitly add
required packages and or configurations.
kiwi no longer uses debootstrap
@Conan-Kudo Conan-Kudo merged commit 3d5b972 into main Aug 3, 2024
12 checks passed
@Conan-Kudo Conan-Kudo deleted the get_rid_of_debootstrap branch August 3, 2024 21:34
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.

Use apt instead of debootstrap for bootstrapping Debian/Ubuntu environments
3 participants