diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/initprofile.sh b/confluent_osdeploy/ubuntu22.04/profiles/default/initprofile.sh index cebcd41d..3d6127b8 100644 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/initprofile.sh +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/initprofile.sh @@ -1,14 +1,23 @@ -#!/bin/sh -sed -i 's/label: ubuntu/label: Ubuntu/' $2/profile.yaml && \ -ln -s $1/casper/vmlinuz $2/boot/kernel && \ -ln -s $1/casper/initrd $2/boot/initramfs/distribution && \ -mkdir -p $2/boot/efi/boot && \ +#!/bin/bash +set -e +sed -i 's/label: ubuntu/label: Ubuntu/' $2/profile.yaml +if [ -e $1/casper/hwe-vmlinuz ]; then + ln -s $1/casper/hwe-vmlinuz $2/boot/kernel +else + ln -s $1/casper/vmlinuz $2/boot/kernel +fi +if [ -e $1/casper/hwe-initrd ]; then + ln -s $1/casper/hwe-initrd $2/boot/initramfs/distribution +else + ln -s $1/casper/initrd $2/boot/initramfs/distribution +fi +mkdir -p $2/boot/efi/boot if [ -d $1/EFI/boot/ ]; then ln -s $1/EFI/boot/* $2/boot/efi/boot elif [ -d $1/efi/boot/ ]; then ln -s $1/efi/boot/* $2/boot/efi/boot else - echo "Unrecogrized boot contents in media" >&2 + echo "Unrecognized boot contents in media" >&2 exit 1 fi diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 80673bb0..060f8794 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -250,8 +250,13 @@ def extract_entries(entries, flags=0, callback=None, totalsize=None, extractlist for entry in entries: if str(entry).endswith('TRANS.TBL'): continue - if extractlist and str(entry).lower() not in extractlist: - continue + if extractlist: + normname = str(entry).lower() + for extent in extractlist: + if fnmatch(normname, extent): + break + else: + continue write_header(write_p, entry._entry_p) read_p = entry._archive_p while 1: @@ -553,11 +558,11 @@ def check_ubuntu(isoinfo): 'method': EXTRACT, 'category': 'ubuntu{0}'.format(major)} elif 'efi/boot/bootaa64.efi' in isoinfo[0]: - exlist = ['casper/vmlinuz', 'casper/initrd', + exlist = ['casper/*vmlinuz', 'casper/*initrd', 'efi/boot/bootaa64.efi', 'efi/boot/grubaa64.efi' ] else: - exlist = ['casper/vmlinuz', 'casper/initrd', + exlist = ['casper/*vmlinuz', 'casper/*initrd', 'efi/boot/bootx64.efi', 'efi/boot/grubx64.efi' ] return {'name': 'ubuntu-{0}-{1}'.format(ver, arch),