Skip to content

Commit e26fc01

Browse files
committed
[MultiBootManager] chkroot add swap Partition Support
1 parent fb467ac commit e26fc01

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/python/Screens/MultiBootManager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,11 @@ def createSlots(self):
896896
cmdlist.append(f"/bin/touch /dev/nomount.{TARGET} > /dev/null 2>&1")
897897
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} mklabel gpt")
898898
cmdlist.append(f"/usr/sbin/partprobe {TARGET_DEVICE}")
899-
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} mkpart rootfs ext4 1MB 100%")
899+
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} unit MiB mkpart rootfs ext4 1MB -- -256MiB")
900+
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} unit MiB mkpart swap linux-swap -- -256MiB 100%")
900901
cmdlist.append(f"/usr/sbin/partprobe {TARGET_DEVICE}")
901902
cmdlist.append(f"/sbin/mkfs.ext4 -O ^64bit,^extent,^flex_bg,^huge_file,^dir_nlink,^extra_isize,^metadata_csum -F -L rootfs {PART(1)}")
903+
cmdlist.append(f"/sbin/mkswap -L swap {PART(2)}")
902904
cmdlist.append(f"/bin/mkdir -p {MOUNTPOINT}")
903905
cmdlist.append(f"/bin/umount {MOUNTPOINT} > /dev/null 2>&1")
904906
cmdlist.append(f"/bin/mount {realDevice} {MOUNTPOINT}")
@@ -1081,10 +1083,12 @@ def createSlots(self):
10811083
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} mklabel gpt")
10821084
cmdlist.append(f"/usr/sbin/partprobe {TARGET_DEVICE}")
10831085
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} mkpart startup fat32 8192s 5MB")
1084-
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} mkpart rootfs ext4 5MB 100%")
1086+
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} unit MiB mkpart rootfs ext4 5MiB -- -256MiB")
1087+
cmdlist.append(f"/usr/sbin/parted --script {TARGET_DEVICE} unit MiB mkpart swap linux-swap -- -256MiB 100%")
10851088
cmdlist.append(f"/usr/sbin/partprobe {TARGET_DEVICE}")
10861089
cmdlist.append(f"/usr/sbin/mkfs.vfat -F 32 -n STARTUP {PART(1)}")
10871090
cmdlist.append(f"/sbin/mkfs.ext4 -O ^64bit,^extent,^flex_bg,^huge_file,^dir_nlink,^extra_isize,^metadata_csum -F -L rootfs {PART(2)}")
1091+
cmdlist.append(f"/sbin/mkswap -L swap {PART(3)}")
10881092
cmdlist.append(f"/bin/mkdir -p {MOUNTPOINT}")
10891093
cmdlist.append(f"/bin/umount {MOUNTPOINT} > /dev/null 2>&1")
10901094
cmdlist.append(f"/bin/mount {PART(1)} {MOUNTPOINT}")

0 commit comments

Comments
 (0)