1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

sync: Make this work for Fedora

Fedora has grub2-install (rather than grub-install), and it expects
grub.cfg to be placed in boot/grub2/ rather than boot/grub/.
This commit is contained in:
Robin Burchell 2019-06-02 14:26:25 +02:00 committed by Andreas Kling
parent 7bce096afd
commit 466a817950

View file

@ -54,11 +54,23 @@ mkdir -p mnt/{boot,bin,etc,proc,tmp}
chmod 1777 mnt/tmp chmod 1777 mnt/tmp
echo "done" echo "done"
echo "installing grub..." grub=$(which grub-install 2>/dev/null) || true
mkdir -p mnt/boot/grub if [[ -z "$grub" ]]; then
cp grub.cfg mnt/boot/grub/grub.cfg grub=$(which grub2-install 2>/dev/null) || true
grub-install --boot-directory=mnt/boot --target=i386-pc --modules="ext2 part_msdos" ${dev} fi
echo "done" if [ -z "$grub" ]; then
echo "can't find a grub-install or grub2-install binary, oh no"
exit 1
fi
echo "installing grub using $grub..."
$grub --boot-directory=mnt/boot --target=i386-pc --modules="ext2 part_msdos" ${dev}
if [ -d mnt/boot/grub2 ]; then
cp grub.cfg mnt/boot/grub2/grub.cfg
else
cp grub.cfg mnt/boot/grub/grub.cfg
fi
echo -n "setting up device nodes... " echo -n "setting up device nodes... "
mkdir -p mnt/dev mkdir -p mnt/dev