Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ZoL additions and modifications:
* Get first line of grub-probe only (to avoid multiple lines fead to mkmapfs).
* Only copy the zpool.cache file if it exists.
* STDERR from lvdisplay in pipe to grep.
* Grub needs a device.map to be able to find a filesystem on a partition which is part of a ZFS pool

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
  • Loading branch information
FransUrbo committed Nov 23, 2014
1 parent e4ad622 commit e553941
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
grub-installer (1.101.ZOL1) unstable; urgency=medium

* If finding multiple [br]ootfs, only use the first one.

-- Turbo Fredriksson <turbo@bayour.com> Tue, 11 Nov 2014 16:07:06 +0100

grub-installer (1.101) unstable; urgency=medium

[ Steve McIntyre ]
Expand Down
12 changes: 9 additions & 3 deletions grub-installer
Expand Up @@ -155,7 +155,7 @@ update_grub () {
}

findfs () {
if ! grub_probe -t device $1; then
if ! grub_probe -t device $1 | head -n1; then
mount | grep "on $ROOT${1%/} " | tail -n1 | cut -d' ' -f1
fi
}
Expand Down Expand Up @@ -296,7 +296,7 @@ elif type multipath >/dev/null 2>&1; then
$chroot $ROOT dmsetup mknodes
fi
elif type lvdisplay >/dev/null 2>&1 && \
(lvdisplay "$disc_offered" | grep -q 'LV Name' 2>/dev/null || \
(lvdisplay "$disc_offered" 2>&1 | grep -q 'LV Name' 2>/dev/null || \
[ -e "$(dirname "$disc_offered")/control" ]); then
# Don't set frdev/frdisk here, otherwise you'll end up in different
# code paths below ...
Expand Down Expand Up @@ -911,6 +911,11 @@ make_active_partition () {
bootdev_split="$(split_device "$bootdev")"
bootdisk="${bootdev_split%% *}"
bootpart="${bootdev_split#* }"
if [ "$bootfstype" = "zfs" ] || [ "$rootfstype" = "zfs" ] ; then
# Grub needs a device.map to be able to find a filesystem
# on a partition which is part of a ZFS pool
make_device_map "$bootdev"
fi
;;
\([hf]d[0-9]*\))
make_device_map "$bootdev"
Expand Down Expand Up @@ -981,7 +986,8 @@ db_progress INFO grub-installer/progress/step_config_loader
if [ "$bootfstype" = "zfs" ] || [ "$rootfstype" = "zfs" ] ; then
# Required by update-grub on ZFS
mkdir -p $ROOT/boot/zfs
cp /boot/zfs/zpool.cache $ROOT/boot/zfs/
[ -f /boot/zfs/zpool.cache ] && \
cp /boot/zfs/zpool.cache $ROOT/boot/zfs/
fi

# Delete for idempotency
Expand Down

0 comments on commit e553941

Please sign in to comment.