From 0675f9b338b808052ac1df13c61be763cccaedf4 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Wed, 14 Aug 2024 13:03:50 +0300 Subject: [PATCH] Start using reqpart for partitioning disks in kickstart --- docs/config/microshift-starter.ks | 14 ++++---- docs/contributor/image_mode.md | 11 ++++--- .../config/kickstart.ks.template | 33 +++++++++---------- .../includes/main-prologue.cfg | 29 ++++++++-------- 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/docs/config/microshift-starter.ks b/docs/config/microshift-starter.ks index c8438cc909..96ec09eda0 100644 --- a/docs/config/microshift-starter.ks +++ b/docs/config/microshift-starter.ks @@ -7,14 +7,14 @@ reboot # Configure network to use DHCP and activate on boot network --bootproto=dhcp --device=link --activate --onboot=on -# Partition disk with a 1MB BIOS boot, 200M EFI, 800M boot XFS partition and -# an LVM volume containing a 10GB+ system root. The remainder of the volume -# will be used by the CSI driver for storing data +# Partition the disk with hardware-specific boot and swap partitions, adding an +# LVM volume that contains a 10GB+ system root. The remainder of the volume will +# be used by the CSI driver for storing data. zerombr -clearpart --all --disklabel gpt -part biosboot --fstype=biosboot --size=1 -part /boot/efi --fstype=efi --size=200 -part /boot --fstype=xfs --asprimary --size=800 +clearpart --all --initlabel +# Create boot and swap partitions as required by the current hardware platform +reqpart --add-boot +# Add an LVM volume group and allocate a system root logical volume part pv.01 --grow volgroup rhel pv.01 logvol / --vgname=rhel --fstype=xfs --size=10240 --name=root diff --git a/docs/contributor/image_mode.md b/docs/contributor/image_mode.md index 4959a3791a..3f57e2f553 100644 --- a/docs/contributor/image_mode.md +++ b/docs/contributor/image_mode.md @@ -287,13 +287,14 @@ timezone UTC text reboot -# Partition disk with a 1GB boot XFS partition and an LVM volume containing a 10GB+ -# system root. The remainder of the volume is for the CSI driver for storing data. +# Partition the disk with hardware-specific boot and swap partitions, adding an +# LVM volume that contains a 10GB+ system root. The remainder of the volume will +# be used by the CSI driver for storing data. zerombr clearpart --all --initlabel -part biosboot --fstype=biosboot --size=1 --asprimary -part /boot/efi --fstype=efi --size=200 -part /boot --fstype=xfs --asprimary --size=800 +# Create boot and swap partitions as required by the current hardware platform +reqpart --add-boot +# Add an LVM volume group and allocate a system root logical volume part pv.01 --grow volgroup rhel pv.01 logvol / --vgname=rhel --fstype=xfs --size=10240 --name=root diff --git a/scripts/image-builder/config/kickstart.ks.template b/scripts/image-builder/config/kickstart.ks.template index cf4a77bbbe..6b99b66563 100644 --- a/scripts/image-builder/config/kickstart.ks.template +++ b/scripts/image-builder/config/kickstart.ks.template @@ -7,27 +7,26 @@ reboot # Configure network to use DHCP and activate on boot network --bootproto=dhcp --device=link --activate --onboot=on -# Partition disk with a 1MB BIOS boot, 200M EFI, 800M boot XFS partition and -# an LVM volume containing a 10GB+ system root. The remainder of the volume -# will be used by the CSI driver for storing data +# Partition the disk with hardware-specific boot and swap partitions, adding an +# LVM volume that contains a 10GB+ system root. The remainder of the volume will +# be used by the CSI driver for storing data. # -# For example, a 20GB disk would be partitioned in the following way: +# For example, a 20GB disk may be partitioned in the following way: # -# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT -# sda 8:0 0 20G 0 disk -# ├─sda1 8:1 0 1M 0 part -# ├─sda2 8:2 0 200M 0 part /boot/efi -# ├─sda3 8:3 0 800M 0 part /boot -# └─sda4 8:4 0 19G 0 part -# └─rhel-root 253:0 0 10G 0 lvm /sysroot +# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS +# loop0 7:0 0 7.9M 1 loop +# sda 8:0 0 20G 0 disk +# ├─sda1 8:1 0 1G 0 part /boot +# └─sda2 8:2 0 19G 0 part +# └─rhel-root 253:0 0 10G 0 lvm /sysroot +# sr0 11:0 1 1024M 0 rom +# zram0 252:0 0 3.6G 0 disk [SWAP] # zerombr -clearpart --all --disklabel gpt -part biosboot --fstype=biosboot --size=1 -part /boot/efi --fstype=efi --size=200 -part /boot --fstype=xfs --asprimary --size=800 -# Uncomment this line to add a SWAP partition of the recommended size -#part swap --fstype=swap --recommended +clearpart --all --initlabel +# Create boot and swap partitions as required by the current hardware platform +reqpart --add-boot +# Add an LVM volume group and allocate a system root logical volume part pv.01 --grow volgroup rhel pv.01 logvol / --vgname=rhel --fstype=xfs --size=REPLACE_LVM_SYSROOT_SIZE --name=root diff --git a/test/kickstart-templates/includes/main-prologue.cfg b/test/kickstart-templates/includes/main-prologue.cfg index 1e296b0431..3607812175 100644 --- a/test/kickstart-templates/includes/main-prologue.cfg +++ b/test/kickstart-templates/includes/main-prologue.cfg @@ -4,25 +4,26 @@ timezone UTC text reboot -# Partition disk with a 1GB boot XFS partition and an LVM volume containing a 10GB+ system root -# The remainder of the volume will be used by the CSI driver for storing data +# Partition the disk with hardware-specific boot and swap partitions, adding an +# LVM volume that contains a 10GB+ system root. The remainder of the volume will +# be used by the CSI driver for storing data. # -# For example, a 20GB disk would be partitioned in the following way: +# For example, a 20GB disk may be partitioned in the following way: # -# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT -# sda 8:0 0 20G 0 disk -# ├─sda1 8:1 0 200M 0 part /boot/efi -# ├─sda1 8:1 0 800M 0 part /boot -# └─sda2 8:2 0 19G 0 part -# └─rhel-root 253:0 0 10G 0 lvm /sysroot +# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS +# loop0 7:0 0 7.9M 1 loop +# sda 8:0 0 20G 0 disk +# ├─sda1 8:1 0 1G 0 part /boot +# └─sda2 8:2 0 19G 0 part +# └─rhel-root 253:0 0 10G 0 lvm /sysroot +# sr0 11:0 1 1024M 0 rom +# zram0 252:0 0 3.6G 0 disk [SWAP] # zerombr clearpart --all --initlabel -part biosboot --fstype=biosboot --size=1 --asprimary -part /boot/efi --fstype=efi --size=200 -part /boot --fstype=xfs --asprimary --size=800 -# Uncomment this line to add a SWAP partition of the recommended size -#part swap --fstype=swap --recommended +# Create boot and swap partitions as required by the current hardware platform +reqpart --add-boot +# Add an LVM volume group and allocate a system root logical volume part pv.01 --grow volgroup rhel pv.01 logvol / --vgname=rhel --fstype=xfs --size=REPLACE_LVM_SYSROOT_SIZE --name=root