Skip to content

Commit

Permalink
src/cmd-buildextend-live: Refactor variable declarations
Browse files Browse the repository at this point in the history
 -  Moved variable declarations to top to enhance clarity.

Signed-off-by: Renata Ravanelli <[email protected]>
  • Loading branch information
ravanelli committed Oct 29, 2024
1 parent 4b076c6 commit 8c53a55
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/cmd-buildextend-live
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ name_version = f'{base_name}-{args.build}'
# to shorten this more intelligently, otherwise we truncate the
# version which may impede uniqueness.
volid = name_version[0:32]

kernel_name = f'{base_name}-{args.build}-live-kernel-{basearch}'
initramfs_name = f'{base_name}-{args.build}-live-initramfs.{basearch}.img'
rootfs_name = f'{base_name}-{args.build}-live-rootfs.{basearch}.img'
kernel_file = os.path.join(builddir, kernel_name)
initramfs_file = os.path.join(builddir, initramfs_name)
rootfs_file = os.path.join(builddir, rootfs_name)
# The kernel requires that uncompressed cpio archives appended to an initrd
# start on a 4-byte boundary. If there's misalignment, it stops unpacking
# and says:
Expand Down Expand Up @@ -763,13 +768,6 @@ boot
}
})
shutil.move(tmpisofile, f"{builddir}/{iso_name}")

kernel_name = f'{base_name}-{args.build}-live-kernel-{basearch}'
initramfs_name = f'{base_name}-{args.build}-live-initramfs.{basearch}.img'
rootfs_name = f'{base_name}-{args.build}-live-rootfs.{basearch}.img'
kernel_file = os.path.join(builddir, kernel_name)
initramfs_file = os.path.join(builddir, initramfs_name)
rootfs_file = os.path.join(builddir, rootfs_name)
shutil.copyfile(os.path.join(tmpisoimagespxe, kernel_img), kernel_file)
shutil.move(pxe_initramfs, initramfs_file)
shutil.move(pxe_rootfs, rootfs_file)
Expand Down

0 comments on commit 8c53a55

Please sign in to comment.