adjust all LVM's to use %pre

This commit is contained in:
Louis Abel 2023-01-26 14:37:53 -07:00
parent 9d3f4cd6c2
commit 1be3dbad2c
Signed by: label
GPG Key ID: B37E62D143879B36
4 changed files with 108 additions and 39 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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