From ac2474f43e44806c35a65b12323da505b7afaf51 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 14 Jun 2021 15:17:54 -0400 Subject: [PATCH] Attempt to fixup ownership, if applicable on the output --- imgutil/imgutil | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/imgutil/imgutil b/imgutil/imgutil index 07f2d5ec..9954ac53 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -5,6 +5,7 @@ import ctypes.util import glob import optparse import os +import pwd import re import shutil import struct @@ -336,9 +337,6 @@ def pack_image(opts, args): os.symlink( '/var/lib/confluent/public/site/initramfs.cpio', os.path.join(outdir, 'boot/initramfs/site.cpio')) - #os.symlink( - # '/var/lib/confluent/public/site/initramfs.cpio', - # os.path.join(outdir, 'boot/initramfs/site.cpio')) shutil.copyfile(kvermap[mostrecent], os.path.join(outdir, 'boot/kernel')) shutil.copyfile(initrdname, os.path.join(outdir, 'boot/initramfs/distribution')) shutil.copyfile(os.path.join(args[0], 'boot/efi/EFI/BOOT/BOOTX64.EFI'), os.path.join(outdir, 'boot/efi/boot/BOOTX64.EFI')) @@ -366,7 +364,11 @@ def pack_image(opts, args): '/opt/confluent/lib/osdeploy/{}-diskless/initramfs/addons.cpio'.format( oshandler.oscategory), os.path.join(outdir, 'boot/initramfs/addons.cpio')) - + try: + pwd.getpwnam('confluent') + subprocess.check_call(['chown', '-R', 'confluent', outdir]) + except KeyError: + pass