Fix bugs when main installs fail
This commit is contained in:
parent
823ce8cbf2
commit
815041ff20
|
@ -495,9 +495,11 @@ class VMBuilderScript(VMBuilder):
|
|||
self.log_info(
|
||||
f"Installing system with debootstrap: debootstrap --include={','.join(deb_packages)} {deb_release} {temp_dir} {deb_mirror}"
|
||||
)
|
||||
os.system(
|
||||
ret = os.system(
|
||||
f"debootstrap --include={','.join(deb_packages)} {deb_release} {temp_dir} {deb_mirror}"
|
||||
)
|
||||
if ret > 0:
|
||||
self.fail("Failed to run debootstrap")
|
||||
|
||||
# Bind mount the devfs so we can grub-install later
|
||||
os.system("mount --bind /dev {}/dev".format(temp_dir))
|
||||
|
@ -733,6 +735,7 @@ GRUB_DISABLE_LINUX_UUID=false
|
|||
dst_volume = f"{volume['pool']}/{dst_volume_name}"
|
||||
mapped_dst_volume = f"/dev/rbd/{dst_volume}"
|
||||
mount_path = f"{temp_dir}/{volume['mountpoint']}"
|
||||
self.log_info(f"Unmounting {dst_volume} from {mount_path}")
|
||||
|
||||
if (
|
||||
volume.get("source_volume") is None
|
||||
|
|
|
@ -521,9 +521,11 @@ class VMBuilderScript(VMBuilder):
|
|||
self.log_info(
|
||||
f"Installing system with rinse: rinse --arch {rinse_architecture} --directory {temporary_directory} --distribution {rinse_release} --cache-dir {rinse_cache} --add-pkg-list /tmp/addpkg --verbose {mirror_arg}"
|
||||
)
|
||||
os.system(
|
||||
ret = os.system(
|
||||
f"rinse --arch {rinse_architecture} --directory {temporary_directory} --distribution {rinse_release} --cache-dir {rinse_cache} --add-pkg-list /tmp/addpkg --verbose {mirror_arg}"
|
||||
)
|
||||
if ret > 0:
|
||||
self.fail("Failed to run rinse")
|
||||
|
||||
# Bind mount the devfs, sysfs, and procfs so we can grub-install later
|
||||
os.system("mount --bind /dev {}/dev".format(temporary_directory))
|
||||
|
|
Loading…
Reference in New Issue