Commit 7138cf3f authored by Matti Hyttinen's avatar Matti Hyttinen

Merge branch 'zfsgrubfix' into 'master'

fix bios-grub support for zfs

See merge request !258
parents 96d04c4d 9af6d113
......@@ -708,19 +708,19 @@ bios_bootloader() {
# grub config changes for zfs root
if [ $(findmnt -ln -o FSTYPE ${MOUNTPOINT}) == "zfs" ]; then
# zfs is considered a sparse filesystem so we can't use SAVEDEFAULT
sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i ${MOUNTPOINT}/etc/default/grub
# we need to tell grub where the zfs root is
zroot="zfs=$(findmnt -ln -o SOURCE ${MOUNTPOINT}) rw"
sed -e '/^GRUB_CMDLINE_LINUX_DEFAULT=/s@"$@ '"${zroot}"'"@g' -e '/^GRUB_CMDLINE_LINUX=/s@"$@ '"${zroot}"'"@g' -i ${MOUNTPOINT}/etc/default/grub
# zfs needs ZPOOL_VDEV_NAME_PATH set to properly find the device
echo ZPOOL_VDEV_NAME_PATH=YES >> ${MOUNTPOINT}/etc/environment
export ZPOOL_VDEV_NAME_PATH=YES
# there has to be a better way to do this $(cat ${PACKAGES})
# write this to a script so we can properly set ZPOOL_VDEV_NAME_PATH in the chroot
echo -e "# "'!'"/bin/bash
ln -s /hostlvm /run/lvm
export ZPOOL_VDEV_NAME_PATH=YES
pacman -S --noconfirm --needed grub os-prober
# zfs is considered a sparse filesystem so we can't use SAVEDEFAULT
sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i /etc/default/grub
# we need to tell grub where the zfs root is
zroot=\"zfs=$(findmnt -ln -o SOURCE ${MOUNTPOINT}) rw\"
sed -e '/^GRUB_CMDLINE_LINUX_DEFAULT=/s@\"\$@ '\"\${zroot}\"'\"@g' -e '/^GRUB_CMDLINE_LINUX=/s@\"\$@ '\"\${zroot}\"'\"@g' -i /etc/default/grub
grub-install --target=i386-pc --recheck $DEVICE
pacman -S --noconfirm grub-theme-manjaro" > ${MOUNTPOINT}/usr/bin/grub_installer.sh
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment