resources: Update Ubuntu preseed configuration

The current preseed fails to produce a disk image that is ready to boot
after Ubuntu 20.04 is installed.

The problem was that grub cannot find the boot partition.

This commit addresses this problem by making disk partition table explicit.

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I53a244245e8e18b612730c940b4d6123983a3430
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5-resources/+/38255
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: Bobby R. Bruce <bbruce@ucdavis.edu>
diff --git a/src/boot-exit/disk-image/shared/preseed.cfg b/src/boot-exit/disk-image/shared/preseed.cfg
index b5cd8a7..21b7ab9 100755
--- a/src/boot-exit/disk-image/shared/preseed.cfg
+++ b/src/boot-exit/disk-image/shared/preseed.cfg
@@ -44,6 +44,7 @@
 # Choosing partition scheme
 # This setting should result in MBR
 # gem5 doesn't work with logical volumes
+d-i partman-auto/disk string /dev/vda
 d-i partman-auto/method string regular
 d-i partman-lvm/device_remove_lvm boolean true
 d-i partman-md/device_remove_md boolean true
@@ -51,7 +52,23 @@
 d-i partman-lvm/confirm_nooverwrite boolean true
 
 # Ignoring an option to set the home folder in another partition
-d-i partman-auto/choose_recipe select atomic
+#d-i partman-auto/choose_recipe select atomic
+
+d-i partman-auto/expert_recipe string                         \
+      bootable-root ::                                        \
+              500 10000 1000000000 ext4                       \
+                      method{ format }                        \
+                      format{ }                               \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+              .                                               \
+              64 512 300% linux-swap                          \
+                      method{ swap }                          \
+                      format{ }                               \
+              .
+
+
+d-i partman-auto/choose_recipe select bootable-root
 
 # Finishing disk partition settings
 d-i partman-md/confirm boolean true
@@ -82,9 +99,6 @@
 # Installing grub
 d-i grub-installer/only_debian boolean true
 
-# Specifying which partition to boot
-d-i grub-installer/bootdev  string /dev/sda
-
 # Install to the above partition
 d-i grub-installer/bootdev  string default
 
diff --git a/src/gapbs/disk-image/shared/preseed.cfg b/src/gapbs/disk-image/shared/preseed.cfg
index b5cd8a7..21b7ab9 100644
--- a/src/gapbs/disk-image/shared/preseed.cfg
+++ b/src/gapbs/disk-image/shared/preseed.cfg
@@ -44,6 +44,7 @@
 # Choosing partition scheme
 # This setting should result in MBR
 # gem5 doesn't work with logical volumes
+d-i partman-auto/disk string /dev/vda
 d-i partman-auto/method string regular
 d-i partman-lvm/device_remove_lvm boolean true
 d-i partman-md/device_remove_md boolean true
@@ -51,7 +52,23 @@
 d-i partman-lvm/confirm_nooverwrite boolean true
 
 # Ignoring an option to set the home folder in another partition
-d-i partman-auto/choose_recipe select atomic
+#d-i partman-auto/choose_recipe select atomic
+
+d-i partman-auto/expert_recipe string                         \
+      bootable-root ::                                        \
+              500 10000 1000000000 ext4                       \
+                      method{ format }                        \
+                      format{ }                               \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+              .                                               \
+              64 512 300% linux-swap                          \
+                      method{ swap }                          \
+                      format{ }                               \
+              .
+
+
+d-i partman-auto/choose_recipe select bootable-root
 
 # Finishing disk partition settings
 d-i partman-md/confirm boolean true
@@ -82,9 +99,6 @@
 # Installing grub
 d-i grub-installer/only_debian boolean true
 
-# Specifying which partition to boot
-d-i grub-installer/bootdev  string /dev/sda
-
 # Install to the above partition
 d-i grub-installer/bootdev  string default
 
diff --git a/src/hack-back/disk-image/shared/preseed.cfg b/src/hack-back/disk-image/shared/preseed.cfg
index b5cd8a7..21b7ab9 100755
--- a/src/hack-back/disk-image/shared/preseed.cfg
+++ b/src/hack-back/disk-image/shared/preseed.cfg
@@ -44,6 +44,7 @@
 # Choosing partition scheme
 # This setting should result in MBR
 # gem5 doesn't work with logical volumes
+d-i partman-auto/disk string /dev/vda
 d-i partman-auto/method string regular
 d-i partman-lvm/device_remove_lvm boolean true
 d-i partman-md/device_remove_md boolean true
@@ -51,7 +52,23 @@
 d-i partman-lvm/confirm_nooverwrite boolean true
 
 # Ignoring an option to set the home folder in another partition
-d-i partman-auto/choose_recipe select atomic
+#d-i partman-auto/choose_recipe select atomic
+
+d-i partman-auto/expert_recipe string                         \
+      bootable-root ::                                        \
+              500 10000 1000000000 ext4                       \
+                      method{ format }                        \
+                      format{ }                               \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+              .                                               \
+              64 512 300% linux-swap                          \
+                      method{ swap }                          \
+                      format{ }                               \
+              .
+
+
+d-i partman-auto/choose_recipe select bootable-root
 
 # Finishing disk partition settings
 d-i partman-md/confirm boolean true
@@ -82,9 +99,6 @@
 # Installing grub
 d-i grub-installer/only_debian boolean true
 
-# Specifying which partition to boot
-d-i grub-installer/bootdev  string /dev/sda
-
 # Install to the above partition
 d-i grub-installer/bootdev  string default
 
diff --git a/src/npb/disk-image/shared/preseed.cfg b/src/npb/disk-image/shared/preseed.cfg
index b5cd8a7..21b7ab9 100755
--- a/src/npb/disk-image/shared/preseed.cfg
+++ b/src/npb/disk-image/shared/preseed.cfg
@@ -44,6 +44,7 @@
 # Choosing partition scheme
 # This setting should result in MBR
 # gem5 doesn't work with logical volumes
+d-i partman-auto/disk string /dev/vda
 d-i partman-auto/method string regular
 d-i partman-lvm/device_remove_lvm boolean true
 d-i partman-md/device_remove_md boolean true
@@ -51,7 +52,23 @@
 d-i partman-lvm/confirm_nooverwrite boolean true
 
 # Ignoring an option to set the home folder in another partition
-d-i partman-auto/choose_recipe select atomic
+#d-i partman-auto/choose_recipe select atomic
+
+d-i partman-auto/expert_recipe string                         \
+      bootable-root ::                                        \
+              500 10000 1000000000 ext4                       \
+                      method{ format }                        \
+                      format{ }                               \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+              .                                               \
+              64 512 300% linux-swap                          \
+                      method{ swap }                          \
+                      format{ }                               \
+              .
+
+
+d-i partman-auto/choose_recipe select bootable-root
 
 # Finishing disk partition settings
 d-i partman-md/confirm boolean true
@@ -82,9 +99,6 @@
 # Installing grub
 d-i grub-installer/only_debian boolean true
 
-# Specifying which partition to boot
-d-i grub-installer/bootdev  string /dev/sda
-
 # Install to the above partition
 d-i grub-installer/bootdev  string default
 
diff --git a/src/parsec/disk-image/shared/preseed.cfg b/src/parsec/disk-image/shared/preseed.cfg
index b5cd8a7..21b7ab9 100644
--- a/src/parsec/disk-image/shared/preseed.cfg
+++ b/src/parsec/disk-image/shared/preseed.cfg
@@ -44,6 +44,7 @@
 # Choosing partition scheme
 # This setting should result in MBR
 # gem5 doesn't work with logical volumes
+d-i partman-auto/disk string /dev/vda
 d-i partman-auto/method string regular
 d-i partman-lvm/device_remove_lvm boolean true
 d-i partman-md/device_remove_md boolean true
@@ -51,7 +52,23 @@
 d-i partman-lvm/confirm_nooverwrite boolean true
 
 # Ignoring an option to set the home folder in another partition
-d-i partman-auto/choose_recipe select atomic
+#d-i partman-auto/choose_recipe select atomic
+
+d-i partman-auto/expert_recipe string                         \
+      bootable-root ::                                        \
+              500 10000 1000000000 ext4                       \
+                      method{ format }                        \
+                      format{ }                               \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+              .                                               \
+              64 512 300% linux-swap                          \
+                      method{ swap }                          \
+                      format{ }                               \
+              .
+
+
+d-i partman-auto/choose_recipe select bootable-root
 
 # Finishing disk partition settings
 d-i partman-md/confirm boolean true
@@ -82,9 +99,6 @@
 # Installing grub
 d-i grub-installer/only_debian boolean true
 
-# Specifying which partition to boot
-d-i grub-installer/bootdev  string /dev/sda
-
 # Install to the above partition
 d-i grub-installer/bootdev  string default
 
diff --git a/src/spec-2006/disk-image/shared/preseed.cfg b/src/spec-2006/disk-image/shared/preseed.cfg
index b5cd8a7..21b7ab9 100644
--- a/src/spec-2006/disk-image/shared/preseed.cfg
+++ b/src/spec-2006/disk-image/shared/preseed.cfg
@@ -44,6 +44,7 @@
 # Choosing partition scheme
 # This setting should result in MBR
 # gem5 doesn't work with logical volumes
+d-i partman-auto/disk string /dev/vda
 d-i partman-auto/method string regular
 d-i partman-lvm/device_remove_lvm boolean true
 d-i partman-md/device_remove_md boolean true
@@ -51,7 +52,23 @@
 d-i partman-lvm/confirm_nooverwrite boolean true
 
 # Ignoring an option to set the home folder in another partition
-d-i partman-auto/choose_recipe select atomic
+#d-i partman-auto/choose_recipe select atomic
+
+d-i partman-auto/expert_recipe string                         \
+      bootable-root ::                                        \
+              500 10000 1000000000 ext4                       \
+                      method{ format }                        \
+                      format{ }                               \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+              .                                               \
+              64 512 300% linux-swap                          \
+                      method{ swap }                          \
+                      format{ }                               \
+              .
+
+
+d-i partman-auto/choose_recipe select bootable-root
 
 # Finishing disk partition settings
 d-i partman-md/confirm boolean true
@@ -82,9 +99,6 @@
 # Installing grub
 d-i grub-installer/only_debian boolean true
 
-# Specifying which partition to boot
-d-i grub-installer/bootdev  string /dev/sda
-
 # Install to the above partition
 d-i grub-installer/bootdev  string default
 
diff --git a/src/spec-2017/disk-image/shared/preseed.cfg b/src/spec-2017/disk-image/shared/preseed.cfg
index b5cd8a7..21b7ab9 100644
--- a/src/spec-2017/disk-image/shared/preseed.cfg
+++ b/src/spec-2017/disk-image/shared/preseed.cfg
@@ -44,6 +44,7 @@
 # Choosing partition scheme
 # This setting should result in MBR
 # gem5 doesn't work with logical volumes
+d-i partman-auto/disk string /dev/vda
 d-i partman-auto/method string regular
 d-i partman-lvm/device_remove_lvm boolean true
 d-i partman-md/device_remove_md boolean true
@@ -51,7 +52,23 @@
 d-i partman-lvm/confirm_nooverwrite boolean true
 
 # Ignoring an option to set the home folder in another partition
-d-i partman-auto/choose_recipe select atomic
+#d-i partman-auto/choose_recipe select atomic
+
+d-i partman-auto/expert_recipe string                         \
+      bootable-root ::                                        \
+              500 10000 1000000000 ext4                       \
+                      method{ format }                        \
+                      format{ }                               \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+              .                                               \
+              64 512 300% linux-swap                          \
+                      method{ swap }                          \
+                      format{ }                               \
+              .
+
+
+d-i partman-auto/choose_recipe select bootable-root
 
 # Finishing disk partition settings
 d-i partman-md/confirm boolean true
@@ -82,9 +99,6 @@
 # Installing grub
 d-i grub-installer/only_debian boolean true
 
-# Specifying which partition to boot
-d-i grub-installer/bootdev  string /dev/sda
-
 # Install to the above partition
 d-i grub-installer/bootdev  string default