From 88bc65839f50df16684ac1a828b5249e73448376 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 16 Feb 2022 18:51:21 +0200 Subject: doc: add comment about what step does Sponsored-by: author --- v-i | 1 + 1 file changed, 1 insertion(+) diff --git a/v-i b/v-i index b34555a..8bdd6dd 100755 --- a/v-i +++ b/v-i @@ -248,6 +248,7 @@ def grub(device, root, efi): def vmdb_spec(system, ansible_vars): device = "{{ image }}" steps = [ + # Create partition table. mklabel(device), # Create a partition for UEFI to boot from. mkpart(device, "efi", "0%", "500M"), -- cgit v1.2.1 From be31f03edaccc91e2e12086178cd2442c6dfb2d4 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 16 Feb 2022 18:52:10 +0200 Subject: fix: don't mount anything on root before debootstrap is run Sponsored-by: author --- v-i | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/v-i b/v-i index 8bdd6dd..c8beaaf 100755 --- a/v-i +++ b/v-i @@ -299,12 +299,6 @@ def vmdb_spec(system, ansible_vars): # ext4 seems like a safe choice. If you wanted another file # system, sorry. mkfs("root", "ext4"), - # Mount the root file system. - mount("root"), - # Mount /boot on top of the root file system. - mount("boot", dirname="/boot", mount_on="root"), - # Mount /boot/efi. - mount("efi", dirname="/boot/efi", mount_on="boot"), ] ) @@ -320,6 +314,8 @@ def vmdb_spec(system, ansible_vars): steps.extend( [ + # Mount the root file system. + mount("root"), # If we have a cached version of the installed system, unpack # it now. Otherwise do nothing. Note that if you make any # changes to the steps marked "unless: rootfs_unpacked", you @@ -345,8 +341,13 @@ def vmdb_spec(system, ansible_vars): # If we didn't unpack an existing cache archive, make one now. # Otherwise, skip this step. cache_rootfs("root"), - # This MUST be after the debootstrap step. virtual_filesystems("root"), + # Mount /boot on top of the root file system. This MUST be done after the + # debootstrap step: otherwise the root file system isn't empty, and then + # debootstrap fails. + mount("boot", dirname="/boot", mount_on="root"), + # Mount /boot/efi. + mount("efi", dirname="/boot/efi", mount_on="boot"), # Create /etc/fstab (and, if LUKS is used, /etc/crypttab). fstab("root"), # These MUST come after the fstab step so that they add the -- cgit v1.2.1 From 56d4f5605724931e7ce5c58f5783b3cf6d98feff Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 16 Feb 2022 19:04:00 +0200 Subject: refactor: mount root earlier Sponsored-by: author --- v-i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v-i b/v-i index c8beaaf..f166e8b 100755 --- a/v-i +++ b/v-i @@ -299,6 +299,8 @@ def vmdb_spec(system, ansible_vars): # ext4 seems like a safe choice. If you wanted another file # system, sorry. mkfs("root", "ext4"), + # Mount the root file system. + mount("root"), ] ) @@ -314,8 +316,6 @@ def vmdb_spec(system, ansible_vars): steps.extend( [ - # Mount the root file system. - mount("root"), # If we have a cached version of the installed system, unpack # it now. Otherwise do nothing. Note that if you make any # changes to the steps marked "unless: rootfs_unpacked", you -- cgit v1.2.1 From 3c70d31061bd44f148720b6d94e20ac0abbc6e74 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 16 Feb 2022 19:36:51 +0200 Subject: fix --- v-i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v-i b/v-i index f166e8b..0e38cc6 100755 --- a/v-i +++ b/v-i @@ -323,6 +323,7 @@ def vmdb_spec(system, ansible_vars): # vmdb2 won't do that automatically for you. unpack_rootfs("root"), debootstrap("root"), + virtual_filesystems("root"), apt( "root", [ @@ -341,7 +342,6 @@ def vmdb_spec(system, ansible_vars): # If we didn't unpack an existing cache archive, make one now. # Otherwise, skip this step. cache_rootfs("root"), - virtual_filesystems("root"), # Mount /boot on top of the root file system. This MUST be done after the # debootstrap step: otherwise the root file system isn't empty, and then # debootstrap fails. -- cgit v1.2.1