diff -Nur e-smith-grub-2.6.1.old/root/etc/e-smith/templates/etc/default/grub/GrubCmdLineLinux e-smith-grub-2.6.1/root/etc/e-smith/templates/etc/default/grub/GrubCmdLineLinux --- e-smith-grub-2.6.1.old/root/etc/e-smith/templates/etc/default/grub/GrubCmdLineLinux 2021-02-20 12:10:34.255000000 -0500 +++ e-smith-grub-2.6.1/root/etc/e-smith/templates/etc/default/grub/GrubCmdLineLinux 2021-02-20 12:12:07.926000000 -0500 @@ -1,12 +1,35 @@ { - #GRUB_CMDLINE_LINUX="rd.lvm.lv=main/root rd.lvm.lv=main/swap rhgb quiet" - # to GRUB_CMDLINE_LINUX="rd.lvm.lv=main/root rd.lvm.lv=main/swap rhgb quiet rootflags=uquota,pquota" - # also remove noquota - @lines = map { - /^GRUB_CMDLINE_LINUX/ && s/noquota//; - /^GRUB_CMDLINE_LINUX/ && ! /rootflags=uquota,pquota/ && s/"$/ rootflags=uquota,pquota"/; - $_ - } @lines; + # parse fstab to know what fstype is root partition + my $fstype = "ext4"; + my @patterns = ( qr/\s\/\s+xfs\s+/, qr/^\/dev\/main\/.*\s+xfs\s+/ ); + open (RD, ") + { + chop; + $fstype="xfs" if ( $_ ~~ @patterns ); + } + close(RD); + + if ( $fstype eq "xfs" ) { + # GRUB_CMDLINE_LINUX="rd.lvm.lv=main/root rd.lvm.lv=main/swap rhgb quiet" + # to GRUB_CMDLINE_LINUX="rd.lvm.lv=main/root rd.lvm.lv=main/swap rhgb quiet rootflags=uquota,pquota" + # also remove noquota + @lines = map { + /^GRUB_CMDLINE_LINUX/ && s/noquota//; + /^GRUB_CMDLINE_LINUX/ && ! /rootflags=uquota,pquota/ && s/"$/ rootflags=uquota,pquota"/; + $_ + } @lines; + } else { + # if we are using ext[234] or any other fs type let's default to ... + @lines = map { + /^GRUB_CMDLINE_LINUX/ && s/noquota//; + /^GRUB_CMDLINE_LINUX/ && /rootflags=uquota,pquota/ && s/rootflags=uquota,pquota//; + $_ + } @lines; + + + } ""; }