35 lines
950 B
Bash
Executable File
35 lines
950 B
Bash
Executable File
#!/bin/bash
|
|
|
|
efimode=`cat /proc/cmdline | sed 's/.*efimode=\([^ ]*\).*/\1/'`
|
|
upgrubcmd="/usr/sbin/update-grub"
|
|
source ./functions
|
|
|
|
if [ $efimode == "y" ];then
|
|
|
|
efi_dir="/Rocky/boot-efi"
|
|
|
|
mkdir -p $TARGET/boot/efi/efi/boot
|
|
|
|
cp ${efi_dir}/bootx64.efi $TARGET/boot/efi/efi/boot
|
|
|
|
cp -r ${efi_dir}/x86_64-efi $TARGET/boot/efi/efi/boot
|
|
|
|
cp $TARGET/boot/grub/grub.cfg $TARGET/boot/efi/efi/boot
|
|
|
|
#echo 'exec grub-mkconfig -o /boot/efi/efi/boot/x86_64-efi/grub.cfg $@ ' >> $TARGET/$upgrubcmd
|
|
|
|
sed -i 's/\/boot\/grub\/grub.cfg/\/boot\/efi\/efi\/boot\/grub.cfg/' $TARGET/$upgrubcmd
|
|
|
|
ln -snf /boot/efi/efi/boot/grub.cfg $TARGET/boot/grub/grub.cfg
|
|
|
|
echo -e "Install efi successfully !"
|
|
else
|
|
|
|
mkdir $TARGET/opt/fbdev
|
|
mv $TARGET/usr/lib64/xorg/modules/drivers/fbdev_drv.la $TARGET/opt/fbdev
|
|
mv $TARGET/usr/lib64/xorg/modules/drivers/fbdev_drv.so $TARGET/opt/fbdev
|
|
sed -i "s/fbdev/vesa/g" $TARGET/etc/X11/xorg.conf
|
|
|
|
echo -e "not efi mode !"
|
|
fi
|