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

Debian: Added support for versions 10, 11 and 12 #162

Merged
merged 22 commits into from
Nov 21, 2023

Conversation

alanbach
Copy link
Contributor

Added experimental support for Debian 10 (Buster), 11 (Bullseye) & 12 (Bookworm).

Closes #24

preventing builds to fail.
preventing builds to fail.
years, added some comments and moved clean-up
commands to its respective script.
10 (Buster), 11 (Bullseye) & 12 (Bookworm) support.

Closes canonical#24
Copy link
Contributor

@alexsander-souza alexsander-souza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome contribution, but this needs some cleanup

  • remove changes to the ubuntu template, I believe they belong to another PR
  • remove unused scripts from debian/scripts, I think they were copied from ubuntu but not required by the image you are building.

@alanbach
Copy link
Contributor Author

awesome contribution, but this needs some cleanup

* remove changes to the `ubuntu` template, I believe they belong to another PR

* remove unused scripts from `debian/scripts`, I think they were copied from `ubuntu` but not required by the image you are building.

These changes have been applied.

@proegssilb
Copy link

proegssilb commented Nov 20, 2023

@alanbach Did your changes make it into the PR? Github is claiming that you still have changes to Ubuntu in the PR.

@alanbach
Copy link
Contributor Author

@alanbach Did your changes make it into the PR? Github is claiming that you still have changes to Ubuntu in the PR.

@proegssilb I don't know why changes that were a part of a different PR are showing up here. Those are already merged and this looks to me some sort of a snag.

@proegssilb
Copy link

Looks like that merge cleaned up the Ubuntu changes. Didn't check the scripts, but hopefully this PR can be re-reviewed soon. Thanks alanbach!

@alanbach
Copy link
Contributor Author

Yup, the branch re-sync cleaned it up. Give this a try and let me know if you hit any issues! Hopefully we can get this merged soon.

@proegssilb
Copy link

Still working on troubleshooting my setup. I'll post if there's any issues, but I wouldn't advise using my difficulties as an excuse to delay this PR. I probably just need to read through the README and logs in more detail until I can figure out what's going on. And then maybe we can update the README in a future PR.

@erickellerek1
Copy link

also trying to use this template to build debian arm64 maas images.
I found out that the readme is missing some dependencies for arm: qemu-system-arm qemu-efi-aarch64 maybe adding these would prevent people from getting following qemu/packer error: cannot stat '/usr/share/AAVMF/AAVMF_VARS.fd': No such file or directory

Copy link

@erickellerek1 erickellerek1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using this template for ARM64 architecture would require some minor changes.

debian/scripts/cloudimg/setup-boot.sh Outdated Show resolved Hide resolved
debian/scripts/cloudimg/setup-boot.sh Outdated Show resolved Hide resolved
debian/scripts/setup-bootloader Outdated Show resolved Hide resolved
@lwandrebeck
Copy link
Contributor

lwandrebeck commented Nov 20, 2023

MAAS snap latest/edge (thus 3.5.0-alpha1), with packer-maas on your PR-24 branch.
flat storage, / ext4, /var xfs.
Image built with sudo packer build -var kernel=linux-image-amd64 -var customize_script=tweaks.sh -var debian_series=bookworm -var debian_version=12 -only='cloudimg.*' .
tweaks.sh contains only apt-get install -y lvm2 xfsprogs otherwise
curtin fails with E: Unable to locate package lvm2 or E: Unable to locate package xfsprogs
Image uploaded with sudo maas $LOGIN boot-resources create name='custom/debian-12' title='debian-12' architecture='amd64/generic' filetype='tgz' content@=debian-custom-cloudimg.tar.gz
/var/snap/maas/current/preseeds/curtin_userdata_custom is a copy of
the file from this PR.
machine boots, BUT once arrived at systemd I get:

  • hostname not properly defined
  • systemd is slow (30 sec per step)
  • network looks broken
    IMG_20231120_141248.jpg

IMG_20231120_143225.jpg

Trying to dig why.
EDIT: same symptoms on 10 and 11.

@lwandrebeck
Copy link
Contributor

btw, /var/snap/maas/current/preseeds/curtin_userdata_custom breaks known to work tweaked ubuntu image deployment, works again with file removed. Don’t know MAAS internals enough to know if a conditional (on uname or something ?) would do the trick to prevent other OSes breakage.

@alexsander-souza
Copy link
Contributor

btw, /var/snap/maas/current/preseeds/curtin_userdata_custom breaks known to work tweaked ubuntu image deployment, works again with file removed. Don’t know MAAS internals enough to know if a conditional (on uname or something ?) would do the trick to prevent other OSes breakage.

you can name the preseed as curtin_userdata_custom_amd64_generic_debian-10, assuming amd64/generic as node architecture and that you called the image custom/debian-10 when uploading

@proegssilb
Copy link

you can name the preseed as curtin_userdata_custom_amd64_generic_debian-10, assuming amd64/generic as node architecture and that you called the image custom/debian-10 when uploading

Can we get this into the readme, or link to the relevant documentation from the readme?

debian/README.md Outdated Show resolved Hide resolved
debian/scripts/curtin-hooks Outdated Show resolved Hide resolved
debian/scripts/cloudimg/cleanup.sh Outdated Show resolved Hide resolved
debian/scripts/cloudimg/curtin-hooks Outdated Show resolved Hide resolved
debian/scripts/cloudimg/install-custom-kernel.sh Outdated Show resolved Hide resolved
debian/scripts/cloudimg/setup-boot.sh Outdated Show resolved Hide resolved
debian/scripts/cloudimg/setup-curtin.sh Outdated Show resolved Hide resolved
debian/packages/get-kernel.sh Outdated Show resolved Hide resolved
@lwandrebeck
Copy link
Contributor

btw, /var/snap/maas/current/preseeds/curtin_userdata_custom breaks known to work tweaked ubuntu image deployment, works again with file removed. Don’t know MAAS internals enough to know if a conditional (on uname or something ?) would do the trick to prevent other OSes breakage.

you can name the preseed as curtin_userdata_custom_amd64_generic_debian-10, assuming amd64/generic as node architecture and that you called the image custom/debian-10 when uploading

works fine ! Thanks for the tip @alexsander-souza 👍

@alanbach
Copy link
Contributor Author

MAAS snap latest/edge (thus 3.5.0-alpha1), with packer-maas on your PR-24 branch. flat storage, / ext4, /var xfs. Image built with sudo packer build -var kernel=linux-image-amd64 -var customize_script=tweaks.sh -var debian_series=bookworm -var debian_version=12 -only='cloudimg.*' . tweaks.sh contains only apt-get install -y lvm2 xfsprogs otherwise curtin fails with E: Unable to locate package lvm2 or E: Unable to locate package xfsprogs Image uploaded with sudo maas $LOGIN boot-resources create name='custom/debian-12' title='debian-12' architecture='amd64/generic' filetype='tgz' content@=debian-custom-cloudimg.tar.gz /var/snap/maas/current/preseeds/curtin_userdata_custom is a copy of the file from this PR. machine boots, BUT once arrived at systemd I get:

Good catch with lvm/xfsprogs. I'll get that fixed.

debian/README.md Outdated Show resolved Hide resolved
@alanbach
Copy link
Contributor Author

Can we get this into the readme, or link to the relevant documentation from the readme?

Done.

customize_script in the main README.md
Copy link
Contributor

@alexsander-souza alexsander-souza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's expand these wrappers, otherwise it's hard to tell what the template is doing

debian/scripts/networking.sh Outdated Show resolved Hide resolved
debian/scripts/networking.sh Outdated Show resolved Hide resolved
debian/scripts/networking.sh Outdated Show resolved Hide resolved
@proegssilb
Copy link

Lightly tested commit 319fc01 . Compiling amd64 images via make seems to work OK. Whatever issues I was having before seem to be gone.

@alanbach
Copy link
Contributor Author

Thank you. Currently working on completing the arm64 support.

@alanbach
Copy link
Contributor Author

OK, just tested building and deploying arm64 Buster, Bullseye and Bookworm images. They all worked, just a small note that the preseed file needs to be updated for arm64 since the kernel package name is linux-image-arm64.

Updated the README file and included a separate ready to use arm64 preseed file as well.

Please try out the new changes and let me know if you see any issues.

Copy link
Contributor

@alexsander-souza alexsander-souza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexsander-souza alexsander-souza merged commit ce34b3d into canonical:main Nov 21, 2023
1 check passed
@lwandrebeck
Copy link
Contributor

quick test, bookworm installed and worked fine on x86_64 with your latest commits ! thanks a lot @alanbach

@lwandrebeck
Copy link
Contributor

Debian 11 worked too. 10 fails like on yesterday photos.

@alanbach alanbach deleted the PR-24 branch November 24, 2023 23:32
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.

Debian 10 template
6 participants