diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 3b22b621..bc61bbb5 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -773,13 +773,15 @@ def generate_stock_profiles(defprofile, distpath, targpath, osname, yout.write('# This manifest enables rebase to know original source of profile data and if any customizations have been done\n') manifestdata = {'distdir': srcname, 'disthashes': hmap} yout.write(yaml.dump(manifestdata, default_flow_style=False)) - initrds = os.listdir('{0}/initramfs'.format(defprofile)) + initrds = ['{0}/initramfs/{1}'.format(defprofile, initrd) for initrd in os.listdir('{0}/initramfs'.format(defprofile))] if os.path.exists('{0}/initramfs/{1}'.format(defprofile, arch)): - initrds.extend(os.listdir('{0}/initramfs/{1}'.format(defprofile, arch))) - for initrd in initrds: - fullpath = '{0}/initramfs/{1}'.format(defprofile, initrd) + initrds.extend(['{0}/initramfs/{1}/{2}'.format(defprofile, arch, initrd) for initrd in os.listdir('{0}/initramfs/{1}'.format(defprofile, arch))]) + for fullpath in initrds: + initrd = os.path.basename(fullpath) if os.path.isdir(fullpath): continue + if os.path.exists('{0}/boot/initramfs/{1}'.format(dirname, initrd)): + os.remove('{0}/boot/initramfs/{1}'.format(dirname, initrd)) os.symlink(fullpath, '{0}/boot/initramfs/{1}'.format(dirname, initrd)) os.symlink(