diff --git a/debian/changelog b/debian/changelog index ebf2694d..d21c30f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.348) UNRELEASED; urgency=medium + + * limit grub-install diversion on snappy images to x86 architectures + + -- Oliver Grawert Fri, 09 Oct 2015 12:52:57 +0200 + livecd-rootfs (2.347) wily; urgency=medium * divert grub-install on snappy images during rootfs build diff --git a/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early b/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early index dadb94be..d6fbd500 100755 --- a/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early +++ b/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early @@ -1,13 +1,19 @@ #!/bin/sh -ex -dpkg-divert --quiet --add \ - --divert /usr/sbin/grub-install.REAL --rename \ - /usr/sbin/grub-install +ARCH=$(dpkg --print-architecture) -cat > /usr/sbin/grub-install <<'EOF' +case $ARCH in + i386|amd64) + dpkg-divert --quiet --add \ + --divert /usr/sbin/grub-install.REAL --rename \ + /usr/sbin/grub-install + + cat > /usr/sbin/grub-install <<'EOF' #! /bin/sh echo "grub-install: diverted by livecd-rootfs (will be called later)" >&2 exit 0 EOF -chmod +x /usr/sbin/grub-install + chmod +x /usr/sbin/grub-install + ;; +esac diff --git a/live-build/ubuntu-core/hooks/99-undivert-grub-install.chroot b/live-build/ubuntu-core/hooks/99-undivert-grub-install.chroot index b5f0f25b..0a88ef39 100755 --- a/live-build/ubuntu-core/hooks/99-undivert-grub-install.chroot +++ b/live-build/ubuntu-core/hooks/99-undivert-grub-install.chroot @@ -1,4 +1,10 @@ #! /bin/sh -ex -rm -f /usr/sbin/grub-install -dpkg-divert --quiet --remove --rename /usr/sbin/grub-install +ARCH=$(dpkg --print-architecture) + +case $ARCH in + i386|amd64) + rm -f /usr/sbin/grub-install + dpkg-divert --quiet --remove --rename /usr/sbin/grub-install + ;; +esac