Bug#630350: divert flash-kernel aside while building the chroot
Package: live-build
Version: 3.0~a20-1
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric
On ARM systems with flash-kernel installed, update-initramfs (at least;
possibly the kernel too) will try to install the new kernel and
initramfs into flash. While this is fine for normal systems, it's not a
sane thing to do when building a live filesystem for another machine.
The simplest way to avoid this seems to be to divert flash-kernel aside
while building the chroot. Patch attached.
(livecd-rootfs did this by setting a FLASH_KERNEL_SKIP=1 environment
variable, but that's difficult to support in live-build because of the
way the Chroot function cleans the environment, and in any case a
diversion is much neater.)
Thanks,
--
Colin Watson [cjwatson@ubuntu.com]
>From 8d0ba280480ac80928633fe631dfa6c87dc791d7 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@canonical.com>
Date: Mon, 13 Jun 2011 10:24:37 +0100
Subject: [PATCH] Divert flash-kernel aside while building the chroot.
---
scripts/build/lb_chroot_dpkg | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/scripts/build/lb_chroot_dpkg b/scripts/build/lb_chroot_dpkg
index 25795a3..3194c04 100755
--- a/scripts/build/lb_chroot_dpkg
+++ b/scripts/build/lb_chroot_dpkg
@@ -70,6 +70,10 @@ EOF
touch /var/state/samhain/samhain_file
fi
+ # flash-kernel
+ Chroot chroot dpkg-divert --rename --add /usr/sbin/flash-kernel
+ ln -s /bin/true chroot/usr/sbin/flash-kernel
+
# Creating stage file
Create_stagefile .stage/chroot_dpkg
;;
@@ -85,6 +89,10 @@ EOF
# Manual hacks for special packages
+ # flash-kernel
+ rm -f chroot/usr/sbin/flash-kernel
+ Chroot chroot dpkg-divert --rename --remove /usr/sbin/flash-kernel
+
# samhain
if [ -e /var/state/samhain/samhain_file.orig ]
then
--
1.7.5.3
Reply to: