#13 Added fix for xen drivers in dracut image to have ec2 image booting
Merged 7 months ago by bstinson. Opened 7 months ago by arrfab.
centos/ arrfab/kickstarts EC2_block_fix  into  master

file modified
+22 -2

@@ -3,7 +3,6 @@ 

  shutdown

  firewall --enabled --service=ssh

  firstboot --disable

- ignoredisk --only-use=vda

  keyboard us

  # System language

  lang en_US.UTF-8

@@ -20,7 +19,12 @@ 

  zerombr

  clearpart --all --initlabel 

  reqpart

- part / --fstype="xfs" --ondisk=vda --size=8000

+ part biosboot --fstype=biosboot --size=1 --ondisk vda

+ part / --fstype="xfs" --ondisk=vda --size=7950

+ 

+ %pre --erroronfail

+ /usr/sbin/parted -s /dev/vda mklabel gpt

+ %end

  

  %post --erroronfail

  passwd -d root

@@ -135,6 +139,22 @@ 

  mkdir -p /var/cache/yum

  /usr/sbin/fixfiles -R -a restore

  

+ # remove these for ec2 debugging

+ sed -i -e 's/ rhgb quiet//' /boot/grub/grub.conf

+ 

+ cat > /etc/modprobe.d/blacklist-nouveau.conf << EOL

+ blacklist nouveau

+ EOL

+ 

+ # enable resizing on copied AMIs

+ echo 'install_items+=" sgdisk "' > /etc/dracut.conf.d/sgdisk.conf

+ 

+ echo 'add_drivers+="xen-netfront xen-blkfront "' > /etc/dracut.conf.d/xen.conf

+ # Rerun dracut for the installed kernel (not the running kernel):

+ KERNEL_VERSION=$(rpm -q kernel --qf '%{V}-%{R}.%{arch}\n')

+ dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION

+ 

+ 

  # reorder console entries

  sed -i 's/console=tty0/console=tty0 console=ttyS0,115200n8/' /boot/grub2/grub.cfg

  

file modified
+21 -2

@@ -3,7 +3,6 @@ 

  shutdown

  firewall --enabled --service=ssh

  firstboot --disable

- ignoredisk --only-use=vda

  keyboard us

  # System language

  lang en_US.UTF-8

@@ -20,7 +19,12 @@ 

  zerombr

  clearpart --all --initlabel 

  reqpart

- part / --fstype="xfs" --ondisk=vda --size=8000

+ part biosboot --fstype=biosboot --size=1 --ondisk vda

+ part / --fstype="xfs" --ondisk=vda --size=7950

+ 

+ %pre --erroronfail

+ /usr/sbin/parted -s /dev/vda mklabel gpt

+ %end

  

  %post --erroronfail

  passwd -d root

@@ -135,6 +139,21 @@ 

  mkdir -p /var/cache/yum

  /usr/sbin/fixfiles -R -a restore

  

+ # remove these for ec2 debugging

+ sed -i -e 's/ rhgb quiet//' /boot/grub/grub.conf

+ 

+ cat > /etc/modprobe.d/blacklist-nouveau.conf << EOL

+ blacklist nouveau

+ EOL

+ 

+ # enable resizing on copied AMIs

+ echo 'install_items+=" sgdisk "' > /etc/dracut.conf.d/sgdisk.conf

+ 

+ echo 'add_drivers+="xen-netfront xen-blkfront "' > /etc/dracut.conf.d/xen.conf

+ # Rerun dracut for the installed kernel (not the running kernel):

+ KERNEL_VERSION=$(rpm -q kernel --qf '%{V}-%{R}.%{arch}\n')

+ dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION

+ 

  # reorder console entries

  sed -i 's/console=tty0/console=tty0 console=ttyS0,115200n8/' /boot/grub2/grub.cfg

  

This PR would fix the way EC2 image is built (for both Linux and Stream) and I validated that locally built+imported image into EC2 was able to boot with this fix in the kickstart.

Signed-off-by: Fabian Arrotin arrfab@centos.org

1 new commit added

  • For aarch64 reqpart works but we need to lower size : growpart from cloud-utils will extend on boot/deploy
7 months ago

Pull-Request has been merged by bstinson

7 months ago