Open zarcen opened 1 year ago
Seconding this.
Any chance we could get an updated version of the image build process?
The image generation is based in this repo: https://github.com/kubernetes-sigs/image-builder
Generate a qemu image
make build-qemu-ubuntu-2204
When the image is created, run this commands:
TMP_DIR=$(mktemp -d /tmp/packer-maas-XXXX)
echo 'Binding packer qcow2 image output to nbd ...'
modprobe nbd
qemu-nbd -d /dev/nbd4
qemu-nbd -c /dev/nbd4 -n ./output/ubuntu-${OUTPUT_OS_VERSION}-kube-v${K8S_VERSION}/ubuntu-${OUTPUT_OS_VERSION}-kube-v${K8S_VERSION}
echo 'Waiting for partitions to be created...'
tries=0
while [ ! -e /dev/nbd4p1 -a $tries -lt 60 ]; do
sleep 1
tries=$((tries+1))
done
echo "mounting image..."
mount /dev/nbd4p1 $TMP_DIR
echo 'Tarring up image...'
tar -Sczpf u-${OUTPUT_OS_VERSION}-0-k-${IMAGE_K8S_VERSION}-0.tar.gz --selinux -C $TMP_DIR .
echo 'Unmounting image...'
umount $TMP_DIR
qemu-nbd -d /dev/nbd4
rmdir $TMP_DIR
Of course, you need to change the variables names in this code snippet.
A thing I forgot:
If you are generating a EFI image, you need to mount the secound partition at TMP_DIR
mount /dev/nbd4p2 $TMP_DIR
Otherwise, you will generate a image with uefi partition
I am trying the following configs:
#!/usr/bin/bash
set -euox pipefail
if [ "$#" -eq 0 ]; then
echo "No kubernetes version supplied, exiting"
fi
for arg; do
printf 'Begin image generation for k8s version "%s"\n' "$arg"
export K8S_VERSION=$arg
export K8S_DEB_VERSION="${K8S_VERSION}-1.1"
if [[ "${K8S_VERSION}" =~ ^[0-9]\.[0-9]{0,3}\.[0-9]{0,3}$ ]]; then
echo "Valid k8s version"
else
echo "Invalid k8s version"
exit 1
fi
export K8S_SERIES=`echo "${K8S_VERSION}" | awk 'BEGIN {FS="."; OFS="."} {print $1,$2}'`
export IMAGE_K8S_VERSION=`echo "${K8S_VERSION}" | awk 'BEGIN {FS="."; OFS=""} {print $1,$2,$3}'`
export OUTPUT_OS_VERSION="2204"
cat ./packer/qemu/qemu-ubuntu-${OUTPUT_OS_VERSION}.json | jq ". + {\"kubernetes_deb_version\": \"${K8S_DEB_VERSION}\", \"kubernetes_semver\": \"v${K8S_VERSION}\", \"kubernetes_series\": \"v${K8S_SERIES}\"}" > ./packer/qemu/qemu-ubuntu-$OUTPUT_OS_VERSION.json.tmp
mv ./packer/qemu/qemu-ubuntu-${OUTPUT_OS_VERSION}.json.tmp ./packer/qemu/qemu-ubuntu-${OUTPUT_OS_VERSION}.json
cat ./packer/qemu/qemu-ubuntu-${OUTPUT_OS_VERSION}.json
make deps-qemu
export PACKER_LOG=1
PATH=$PATH make build-qemu-ubuntu-${OUTPUT_OS_VERSION}
TMP_DIR=$(mktemp -d /tmp/packer-maas-XXXX)
echo 'Binding packer qcow2 image output to nbd ...'
modprobe nbd
qemu-nbd -d /dev/nbd4
qemu-nbd -c /dev/nbd4 -n ./output/ubuntu-${OUTPUT_OS_VERSION}-kube-v${K8S_VERSION}/ubuntu-${OUTPUT_OS_VERSION}-kube-v${K8S_VERSION}
echo 'Waiting for partitions to be created...'
tries=0
while [ ! -e /dev/nbd4p1 -a $tries -lt 60 ]; do
sleep 1
tries=$((tries+1))
done
echo "mounting image..."
mount /dev/nbd4p1 $TMP_DIR
echo 'Tarring up image...'
tar -Sczpf ./output/u-${OUTPUT_OS_VERSION}-0-k-${IMAGE_K8S_VERSION}-0.tar.gz --selinux -C $TMP_DIR .
echo 'Unmounting image...'
umount $TMP_DIR
qemu-nbd -d /dev/nbd4
rmdir $TMP_DIR
echo "cleaning image outputs directory"
rm -rf ./output/ubuntu-${OUTPUT_OS_VERSION}-kube-v${K8S_VERSION}/
done
also tried the EFI variant and:
#!/bin/sh
sudo apt install -y qemu-kvm
sudo chmod 666 /dev/kvm
UBUNTU_VERSION="2204"
K8S_VERSION="1.29.2"
IMAGE_K8S_VERSION=`echo "${K8S_VERSION}" | awk 'BEGIN {FS="."; OFS=""} {print $1,$2,$3}'`
docker pull jonnybgod/maas-builder:latest
docker run -it --rm --privileged --net host --device=/dev/kvm -v /dev:/dev -v /lib/modules:/lib/modules -v $(pwd)/images:/image-builder/images/capi/output jonnybgod/maas-builder:latest /image-builder/images/capi/buildmaasimage.sh $K8S_VERSION
FILE_NAME="u-$UBUNTU_VERSION-0-k-$IMAGE_K8S_VERSION-0"
sudo chown $USER:$USER ./images/$FILE_NAME.tar.gz
size=$(du ./images/$FILE_NAME.tar.gz | awk '{print $1;}')
sha256checksum=$(sha256sum $FILE_NAME.tar.gz | awk '{print $1;}')
maas admin boot-resources create name=custom/$FILE_NAME architecture=amd64/generic sha256=$sha256checksum size=$size content@=./images/$FILE_NAME.tar.gz
but the result is:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
grub-efi-amd64 : Conflicts: grub-pc but 2.06-2ubuntu7.2 is to be installed
grub-pc : Conflicts: grub-efi-amd64 but 2.06-2ubuntu14.4 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED subp(['udevadm', 'settle']): 0.018
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: Installing packages on target system: ['efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed']
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/installing-missing-packages: FAIL: installing missing packages
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
Traceback (most recent call last):
File "/curtin/curtin/commands/main.py", line 202, in main
ret = args.func(args)
File "/curtin/curtin/commands/curthooks.py", line 1918, in curthooks
builtin_curthooks(cfg, target, state)
File "/curtin/curtin/commands/curthooks.py", line 1731, in builtin_curthooks
install_missing_packages(cfg, target, osfamily=osfamily)
File "/curtin/curtin/commands/curthooks.py", line 1342, in install_missing_packages
distro.install_packages(to_add, target=target, osfamily=osfamily)
File "/curtin/curtin/distro.py", line 526, in install_packages
return install_cmd('install', args=pkglist, opts=opts, target=target,
File "/curtin/curtin/distro.py", line 308, in run_apt_command
cmd_rv = apt_install(mode, args, opts=opts, env=env, target=target,
File "/curtin/curtin/distro.py", line 356, in apt_install
cmd_rv = inchroot.subp(cmd + dl_opts + packages, env=env,
File "/curtin/curtin/util.py", line 792, in subp
return subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 280, in subp
return _subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 144, in _subp
raise ProcessExecutionError(stdout=out, stderr=err,
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'install', '--download-only', 'efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed']
Exit code: 100
Reason: -
Stdout: ''
Stderr: ''
Unexpected error while running command.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'install', '--download-only', 'efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed']
Exit code: 100
Reason: -
Stdout: ''
Stderr: ''
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'curthooks']
Exit code: 3
Reason: -
Stdout: start: cmd-install/stage-curthooks/builtin/cmd-curthooks: curtin command curthooks
Running curtin builtin curthooks
Configuring target system for distro: ubuntu osfamily: debian
start: cmd-install/stage-curthooks/builtin/cmd-curthooks/writing-apt-config: configuring apt configuring apt
Transferred {'grub2': 'grub2 grub2/update_nvram boolean false', 'maas': 'cloud-init cloud-init/datasources multiselect MAAS\ncloud-init cloud-init/maas-metadata-url string http://192.168.100.94:5248/MAAS/metadata/\ncloud-init cloud-init/maas-metadata-credentials string oauth_consumer_key=egmEps4CjHntVbBQZ4&oauth_token_key=Rg9GrSkJJwV8wM8C5T&oauth_token_secret=7eXueXw4LcGfNc35U6hTtL7ZN4GLa9Z4\ncloud-init cloud-init/local-cloud-config string manage_etc_hosts: true\\nmanual_cache_clean: true\\nreporting:\\n maas:\\n consumer_key: egmEps4CjHntVbBQZ4\\n endpoint: http://192.168.100.94:5248/MAAS/metadata/status/kbefde\\n token_key: Rg9GrSkJJwV8wM8C5T\\n token_secret: 7eXueXw4LcGfNc35U6hTtL7ZN4GLa9Z4\\n type: webhook\\n\n'} into new format: {'preserve_sources_list': False, 'proxy': 'http://192.168.100.94:8000/', 'sources_list': 'deb http://archive.ubuntu.com/ubuntu $RELEASE universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE universe restricted multiverse main\ndeb http://archive.ubuntu.com/ubuntu $RELEASE-updates universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE-updates universe restricted multiverse main\ndeb http://archive.ubuntu.com/ubuntu $RELEASE-security universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE-security universe restricted multiverse main\ndeb http://archive.ubuntu.com/ubuntu $RELEASE-backports universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE-backports universe restricted multiverse main\n', 'debconf_selections': {'grub2': 'grub2 grub2/update_nvram boolean false', 'maas': 'cloud-init cloud-init/datasources multiselect MAAS\ncloud-init cloud-init/maas-metadata-url string http://192.168.100.94:5248/MAAS/metadata/\ncloud-init cloud-init/maas-metadata-credentials string oauth_consumer_key=egmEps4CjHntVbBQZ4&oauth_token_key=Rg9GrSkJJwV8wM8C5T&oauth_token_secret=7eXueXw4LcGfNc35U6hTtL7ZN4GLa9Z4\ncloud-init cloud-init/local-cloud-config string manage_etc_hosts: true\\nmanual_cache_clean: true\\nreporting:\\n maas:\\n consumer_key: egmEps4CjHntVbBQZ4\\n endpoint: http://192.168.100.94:5248/MAAS/metadata/status/kbefde\\n token_key: Rg9GrSkJJwV8wM8C5T\\n token_secret: 7eXueXw4LcGfNc35U6hTtL7ZN4GLa9Z4\\n type: webhook\\n\n'}}
curthooks handling apt to target /tmp/tmpomaodobm/target with config {'preserve_sources_list': False, 'proxy': 'http://192.168.100.94:8000/', 'sources_list': 'deb http://archive.ubuntu.com/ubuntu $RELEASE universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE universe restricted multiverse main\ndeb http://archive.ubuntu.com/ubuntu $RELEASE-updates universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE-updates universe restricted multiverse main\ndeb http://archive.ubuntu.com/ubuntu $RELEASE-security universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE-security universe restricted multiverse main\ndeb http://archive.ubuntu.com/ubuntu $RELEASE-backports universe restricted multiverse main\n# deb-src http://archive.ubuntu.com/ubuntu $RELEASE-backports universe restricted multiverse main\n', 'debconf_selections': {'grub2': 'grub2 grub2/update_nvram boolean false', 'maas': 'cloud-init cloud-init/datasources multiselect MAAS\ncloud-init cloud-init/maas-metadata-url string http://192.168.100.94:5248/MAAS/metadata/\ncloud-init cloud-init/maas-metadata-credentials string oauth_consumer_key=egmEps4CjHntVbBQZ4&oauth_token_key=Rg9GrSkJJwV8wM8C5T&oauth_token_secret=7eXueXw4LcGfNc35U6hTtL7ZN4GLa9Z4\ncloud-init cloud-init/local-cloud-config string manage_etc_hosts: true\\nmanual_cache_clean: true\\nreporting:\\n maas:\\n consumer_key: egmEps4CjHntVbBQZ4\\n endpoint: http://192.168.100.94:5248/MAAS/metadata/status/kbefde\\n token_key: Rg9GrSkJJwV8wM8C5T\\n token_secret: 7eXueXw4LcGfNc35U6hTtL7ZN4GLa9Z4\\n type: webhook\\n\n'}}
Running command ['unshare', '--help'] with allowed return codes [0] (capture=True)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'lsb_release', '--all'] with allowed return codes [0] (capture=True)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'dpkg', '--print-architecture'] with allowed return codes [0] (capture=True)
got primary mirror: None
got security mirror: None
Apt Mirror info: {'PRIMARY': 'http://archive.ubuntu.com/ubuntu/', 'SECURITY': 'http://security.ubuntu.com/ubuntu/', 'MIRROR': 'http://archive.ubuntu.com/ubuntu/'}
Applying debconf selections
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'debconf-set-selections'] with allowed return codes [0] (capture=True)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'dpkg-query', '--list'] with allowed return codes [0] (capture=True)
unconfiguring cloud-init
cleaning cloud-init config from: ['/tmp/tmpomaodobm/target/etc/cloud/cloud.cfg.d/90_dpkg.cfg']
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'dpkg-reconfigure', '--frontend=noninteractive', 'cloud-init'] with allowed return codes [0] (capture=True)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'dpkg-query', '--show', '--showformat', '${Version}', 'cloud-init'] with allowed return codes [0] (capture=True)
Set preserve_sources_list to True in /etc/cloud/cloud.cfg.d/curtin-preserve-sources.cfg with: {'apt': {'preserve_sources_list': True}}
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'dpkg', '--print-architecture'] with allowed return codes [0] (capture=True)
write apt proxy info to /tmp/tmpomaodobm/target/etc/apt/apt.conf.d/90curtin-aptproxy
Running command ['mount', '--bind', '/dev', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/proc', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/run', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/sys', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/sys/firmware/efi/efivars', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Diverting original update-initramfs in target.
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'dpkg-divert', '--add', '--rename', '--divert', '/usr/sbin/update-initramfs.curtin-disabled', '/usr/sbin/update-initramfs'] with allowed return codes [0] (capture=False)
Adding 'local diversion of /usr/sbin/update-initramfs to /usr/sbin/update-initramfs.curtin-disabled'
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED subp(['udevadm', 'settle']): 0.017
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/writing-apt-config: SUCCESS: configuring apt configuring apt
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'lsb_release', '--all'] with allowed return codes [0] (capture=True)
start: cmd-install/stage-curthooks/builtin/cmd-curthooks/installing-missing-packages: installing missing packages
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'dpkg-query', '--list'] with allowed return codes [0] (capture=True)
Curtin config dependencies requires additional packages: ['e2fsprogs']
Running command ['dpkg', '--print-architecture'] with allowed return codes [0] (capture=True)
Running command ['apt-cache', 'pkgnames'] with allowed return codes [0] (capture=True)
Running command ['apt-cache', 'pkgnames'] with allowed return codes [0] (capture=True)
Skipping install of {'grub-efi-amd64', 'ifenslave', 'vlan', 'bridge-utils', 'grub-efi-amd64-signed', 'efibootmgr', 'shim-signed'}. Not needed on netplan system.
start: cmd-install/stage-curthooks/builtin/cmd-curthooks: Installing packages on target system: ['efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed']
Running command ['mount', '--bind', '/dev', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/proc', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/run', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/sys', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/sys/firmware/efi/efivars', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'apt-get', '--quiet', '--option=Acquire::Languages=none', '--option=Dir::Etc::sourcelist=/tmp/tmpoojo65o_/sources.list', '--option=Dir::Etc::sourceparts=/tmp/tmpoojo65o_/sources.list.d', 'update'] with allowed return codes [0] (capture=False)
Running in chroot, ignoring command 'start'
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [129 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 c-n-f Metadata [488 B]
Get:10 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]
Get:3 https://prod-cdn.packages.k8s.io/repositories/isv:/kubernetes:/core:/stable:/v1.28/deb InRelease [1189 B]
Get:11 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B]
Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1395 kB]
Get:13 https://prod-cdn.packages.k8s.io/repositories/isv:/kubernetes:/core:/stable:/v1.28/deb Packages [12.6 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy/main amd64 c-n-f Metadata [30.3 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1059 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [22.1 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1619 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [520 B]
Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [42.1 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [472 B]
Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1502 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [16.1 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [851 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [16.8 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1591 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [520 B]
Get:27 http://archive.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.1 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [260 B]
Get:29 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1286 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [11.4 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [28.4 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [644 B]
Get:33 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]
Get:34 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]
Get:35 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [67.1 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
Fetched 24.9 MB in 3s (7699 kB/s)
Reading package lists...
W: https://pkgs.k8s.io/core:/stable:/v1.28/deb/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED subp(['udevadm', 'settle']): 0.017
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/dev', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/proc', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/run', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/sys', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/sys/firmware/efi/efivars', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'install', '--download-only', 'efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed'] with allowed return codes [0] (capture=False)
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
grub-efi-amd64 : Conflicts: grub-pc but 2.06-2ubuntu7.2 is to be installed
grub-pc : Conflicts: grub-efi-amd64 but 2.06-2ubuntu14.4 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED subp(['udevadm', 'settle']): 0.018
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpomaodobm/target/dev'] with allowed return codes [0] (capture=False)
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: Installing packages on target system: ['efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed']
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/installing-missing-packages: FAIL: installing missing packages
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
Traceback (most recent call last):
File "/curtin/curtin/commands/main.py", line 202, in main
ret = args.func(args)
File "/curtin/curtin/commands/curthooks.py", line 1918, in curthooks
builtin_curthooks(cfg, target, state)
File "/curtin/curtin/commands/curthooks.py", line 1731, in builtin_curthooks
install_missing_packages(cfg, target, osfamily=osfamily)
File "/curtin/curtin/commands/curthooks.py", line 1342, in install_missing_packages
distro.install_packages(to_add, target=target, osfamily=osfamily)
File "/curtin/curtin/distro.py", line 526, in install_packages
return install_cmd('install', args=pkglist, opts=opts, target=target,
File "/curtin/curtin/distro.py", line 308, in run_apt_command
cmd_rv = apt_install(mode, args, opts=opts, env=env, target=target,
File "/curtin/curtin/distro.py", line 356, in apt_install
cmd_rv = inchroot.subp(cmd + dl_opts + packages, env=env,
File "/curtin/curtin/util.py", line 792, in subp
return subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 280, in subp
return _subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 144, in _subp
raise ProcessExecutionError(stdout=out, stderr=err,
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'install', '--download-only', 'efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed']
Exit code: 100
Reason: -
Stdout: ''
Stderr: ''
Unexpected error while running command.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpomaodobm/target', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'install', '--download-only', 'efibootmgr', 'grub-efi-amd64', 'grub-efi-amd64-signed', 'shim-signed']
Exit code: 100
Reason: -
Stdout: ''
Stderr: ''
Stderr: ''
any ideas on how to fix or debug this?
Summary
image-generation.
In this PR #70, I see there are new image built with ubuntu 22.04 and newer k8s versions. However, the content still points out to a very stale branch in this repo: https://github.com/spectrocloud/cluster-api-provider-maas/blob/main/image-generation/Dockerfile#L10C29-L10C90
Is it possible to share what is the current packer configs to generate those ubuntu 22.04 images?