From 1be3dbad2c8a2a9b8854f67870162662bd36dbb8 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Thu, 26 Jan 2023 14:37:53 -0700 Subject: [PATCH] adjust all LVM's to use %pre --- Rocky-8-Azure-LVM.ks | 36 +++++++++++++++++++++--------- Rocky-8-EC2-LVM.ks | 37 ++++++++++++++++++++++--------- Rocky-8-GenericCloud-LVM.ks | 40 ++++++++++++++++++++++++---------- cloud/rocky-cloud-parts-lvm.ks | 34 +++++++++++++++++++++++------ 4 files changed, 108 insertions(+), 39 deletions(-) diff --git a/Rocky-8-Azure-LVM.ks b/Rocky-8-Azure-LVM.ks index 4cd0d95..8bf7799 100644 --- a/Rocky-8-Azure-LVM.ks +++ b/Rocky-8-Azure-LVM.ks @@ -28,17 +28,33 @@ selinux --enforcing services --disabled="kdump" --enabled="NetworkManager,sshd,rsyslog,chronyd,cloud-init,cloud-init-local,cloud-config,cloud-final,rngd" # System bootloader configuration bootloader --append="rootdelay=300 console=ttyS0 earlyprintk=ttyS0 no_timer_check crashkernel=auto net.ifnames=0" --location=mbr --timeout=1 -# Clear the Master Boot Record -zerombr -# Partition clearing information -clearpart --all --initlabel --disklabel=gpt -# Disk partitioning information -part biosboot --fstype="biosboot" --size=1 -part /boot/efi --fstype="efi" --size=100 -part /boot --fstype="xfs" --size=1000 --label=boot -part pv.01 --grow --ondisk=vda --size=1 + +part /boot/efi --fstype=efi --asprimary --onpart=vda1 +part /boot --fstype=xfs --label=boot --onpart=vda2 +part prepboot --fstype=biosboot --asprimary --onpart=vda3 +part biosboot --fstype=biosboot --asprimary --onpart=vda4 +part pv.01 --grow --onpart=vda5 volgroup rocky pv.01 -logvol / --grow --size=8000 --name=root --vgname=rocky +logvol / --vgname=rocky --size=8000 --name=root --grow --mkfsoptions="-m bigtime=0,inobtcount=0" + +%pre +# Clear the Master Boot Record +dd if=/dev/zero of=/dev/vda bs=512 count=1 +# Create a new GPT partition table +parted /dev/vda mklabel gpt +# Create a partition for /boot/efi +parted /dev/vda mkpart primary fat32 1MiB 100MiB +parted /dev/vda set 1 boot on +# Create a partition for /boot +parted /dev/vda mkpart primary xfs 100MiB 1100MiB +# Create a partition for prep +parted /dev/vda mkpart primary 1100MiB 1104MiB +# Create a partition for bios_grub +parted /dev/vda mkpart primary 1104MiB 1105MiB +# Create a partition for LVM +parted /dev/vda mkpart primary ext2 1106MiB 10.7GB +parted /dev/vda set 5 lvm on +%end %post --erroronfail passwd -d root diff --git a/Rocky-8-EC2-LVM.ks b/Rocky-8-EC2-LVM.ks index acea30c..c98e0f3 100644 --- a/Rocky-8-EC2-LVM.ks +++ b/Rocky-8-EC2-LVM.ks @@ -16,18 +16,35 @@ services --disabled="kdump" --enabled="NetworkManager,sshd,rsyslog,chronyd,cloud timezone UTC --isUtc # Disk bootloader --append="console=ttyS0,115200n8 no_timer_check crashkernel=auto net.ifnames=0 nvme_core.io_timeout=4294967295 nvme_core.max_retries=10" --location=mbr --timeout=1 -zerombr -clearpart --all --initlabel -#reqpart -part biosboot --size=1 --fstype=biosboot --asprimary -part /boot/efi --size=100 --fstype=efi --asprimary -part /boot --size=1024 --fstype=xfs --label=boot -part pv.01 --size=1 --ondisk=vda --grow -volgroup rocky pv.01 -logvol / --vgname=rocky --size=8000 --name=root --grow --fstype=xfs --mkfsoptions "-m bigtime=0,inobtcount=0" - url --url https://download.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/ +part /boot/efi --fstype=efi --asprimary --onpart=vda1 +part /boot --fstype=xfs --label=boot --onpart=vda2 +part prepboot --fstype=biosboot --asprimary --onpart=vda3 +part biosboot --fstype=biosboot --asprimary --onpart=vda4 +part pv.01 --grow --onpart=vda5 +volgroup rocky pv.01 +logvol / --vgname=rocky --size=8000 --name=root --grow --mkfsoptions="-m bigtime=0,inobtcount=0" + +%pre +# Clear the Master Boot Record +dd if=/dev/zero of=/dev/vda bs=512 count=1 +# Create a new GPT partition table +parted /dev/vda mklabel gpt +# Create a partition for /boot/efi +parted /dev/vda mkpart primary fat32 1MiB 100MiB +parted /dev/vda set 1 boot on +# Create a partition for /boot +parted /dev/vda mkpart primary xfs 100MiB 1100MiB +# Create a partition for prep +parted /dev/vda mkpart primary 1100MiB 1104MiB +# Create a partition for bios_grub +parted /dev/vda mkpart primary 1104MiB 1105MiB +# Create a partition for LVM +parted /dev/vda mkpart primary ext2 1106MiB 10.7GB +parted /dev/vda set 5 lvm on +%end + %post --erroronfail passwd -d root passwd -l root diff --git a/Rocky-8-GenericCloud-LVM.ks b/Rocky-8-GenericCloud-LVM.ks index a8959ec..14b7ec0 100644 --- a/Rocky-8-GenericCloud-LVM.ks +++ b/Rocky-8-GenericCloud-LVM.ks @@ -14,20 +14,36 @@ network --hostname=localhost.localdomain # Root password services --disabled="kdump" --enabled="NetworkManager,sshd,rsyslog,chronyd,cloud-init,cloud-init-local,cloud-config,cloud-final,rngd" rootpw --iscrypted thereisnopasswordanditslocked - -# Partition stuff -zerombr -clearpart --all --initlabel --disklabel=gpt -#reqpart -part biosboot --size=1 --fstype=biosboot --asprimary -part /boot/efi --size=100 --fstype=efi --asprimary -part /boot --size=1000 --fstype=xfs --label=boot -part pv.01 --size=1 --ondisk=vda --grow -volgroup rocky pv.01 -logvol / --vgname=rocky --size=8000 --name=root --grow +url --url https://download.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/ shutdown -url --url https://download.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/ +# Partition stuff +part /boot/efi --fstype=efi --asprimary --onpart=vda1 +part /boot --fstype=xfs --label=boot --onpart=vda2 +part prepboot --fstype=biosboot --asprimary --onpart=vda3 +part biosboot --fstype=biosboot --asprimary --onpart=vda4 +part pv.01 --grow --onpart=vda5 +volgroup rocky pv.01 +logvol / --vgname=rocky --size=8000 --name=root --grow --mkfsoptions="-m bigtime=0,inobtcount=0" + +%pre +# Clear the Master Boot Record +dd if=/dev/zero of=/dev/vda bs=512 count=1 +# Create a new GPT partition table +parted /dev/vda mklabel gpt +# Create a partition for /boot/efi +parted /dev/vda mkpart primary fat32 1MiB 100MiB +parted /dev/vda set 1 boot on +# Create a partition for /boot +parted /dev/vda mkpart primary xfs 100MiB 1100MiB +# Create a partition for prep +parted /dev/vda mkpart primary 1100MiB 1104MiB +# Create a partition for bios_grub +parted /dev/vda mkpart primary 1104MiB 1105MiB +# Create a partition for LVM +parted /dev/vda mkpart primary ext2 1106MiB 10.7GB +parted /dev/vda set 5 lvm on +%end %packages @core diff --git a/cloud/rocky-cloud-parts-lvm.ks b/cloud/rocky-cloud-parts-lvm.ks index b862de4..85fd637 100644 --- a/cloud/rocky-cloud-parts-lvm.ks +++ b/cloud/rocky-cloud-parts-lvm.ks @@ -1,8 +1,28 @@ -zerombr -clearpart --all --initlabel --disklabel=gpt -part biosboot --size=1 --fstype=biosboot --asprimary -part /boot/efi --size=100 --fstype=efi --asprimary -part /boot --size=1000 --fstype=xfs --label=boot -part pv.01 --size=1 --ondisk=vda --grow +part /boot/efi --fstype=efi --asprimary --onpart=vda1 +part /boot --fstype=xfs --label=boot --onpart=vda2 +part prepboot --fstype=biosboot --asprimary --onpart=vda3 +part biosboot --fstype=biosboot --asprimary --onpart=vda4 +part pv.01 --grow --onpart=vda5 volgroup rocky pv.01 -logvol / --vgname=rocky --size=8000 --name=root --grow +logvol / --vgname=rocky --size=8000 --name=root --grow --mkfsoptions="-m bigtime=0,inobtcount=0" + +%pre +# Clear the Master Boot Record +dd if=/dev/zero of=/dev/vda bs=512 count=1 +# Create a new GPT partition table +parted /dev/vda mklabel gpt +# Create a partition for /boot/efi +parted /dev/vda mkpart primary fat32 1MiB 100MiB +parted /dev/vda set 1 boot on +# Create a partition for /boot +parted /dev/vda mkpart primary xfs 100MiB 1100MiB +# Create a partition for prep +parted /dev/vda mkpart primary 1100MiB 1104MiB +# Create a partition for bios_grub +parted /dev/vda mkpart primary 1104MiB 1105MiB +# Create a partition for LVM +parted /dev/vda mkpart primary ext2 1106MiB 10.7GB +parted /dev/vda set 5 lvm on +%end + +