Bug#627887: add support for jasper initramfs system
On Wed, May 25, 2011 at 11:32:12AM +0100, Colin Watson wrote:
> Oliver suggested that it would be better to use '--initramfs none
> --packages jasper', or similar. This still needs parts of this patch,
> though, as there are too many places that only ever expect LB_INITRAMFS
> to be casper or live-boot, e.g. the output directory calculation in
> lb_binary_rootfs.
>
> Let me know how you'd prefer to proceed here, and I can send an updated
> patch.
How about this patch? This should make '--initramfs none' generally
work more consistently, mostly by filling in a few entries in case
statements.
Thanks,
--
Colin Watson [cjwatson@ubuntu.com]
>From 448eddbbc3eef31b8b368ec04e100ae1b42f7769 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@canonical.com>
Date: Mon, 6 Jun 2011 13:58:44 +0100
Subject: [PATCH] Make --initramfs none work more consistently.
---
scripts/build/lb_binary_grub | 10 +++++++++-
scripts/build/lb_binary_grub2 | 10 +++++++++-
scripts/build/lb_binary_manifest | 5 +++++
scripts/build/lb_binary_memtest | 4 ++++
scripts/build/lb_binary_net | 4 ++++
scripts/build/lb_binary_rootfs | 4 ++++
scripts/build/lb_binary_silo | 7 ++++++-
scripts/build/lb_binary_yaboot | 10 +++++++++-
scripts/build/lb_chroot_hacks | 6 +++++-
9 files changed, 55 insertions(+), 5 deletions(-)
diff --git a/scripts/build/lb_binary_grub b/scripts/build/lb_binary_grub
index ee14bd9..39aca30 100755
--- a/scripts/build/lb_binary_grub
+++ b/scripts/build/lb_binary_grub
@@ -68,7 +68,7 @@ Grub_live_entry ()
APPEND="${4}"
LINUX_LIVE="${LINUX_LIVE}\ntitle\t\tDebian GNU/Linux - ${LABEL}"
- LINUX_LIVE="${LINUX_LIVE}\nkernel\t\t/${KERNEL} boot=${INITFS} config LB_BOOTAPPEND_LIVE ${APPEND}"
+ LINUX_LIVE="${LINUX_LIVE}\nkernel\t\t/${KERNEL} ${INITFS:+boot=${INITFS} }config LB_BOOTAPPEND_LIVE ${APPEND}"
LINUX_LIVE="${LINUX_LIVE}\ninitrd\t\t/${INITRD}"
}
@@ -125,6 +125,10 @@ case "${LB_INITRAMFS}" in
live-boot)
INITFS="live"
;;
+
+ *)
+ INITFS=""
+ ;;
esac
# Setting destination directory
@@ -138,6 +142,10 @@ case "${LB_BINARY_IMAGES}" in
live-boot)
DESTDIR_LIVE="binary/live"
;;
+
+ *)
+ DESTDIR_LIVE="binary/boot"
+ ;;
esac
DESTDIR_INSTALL="binary/install"
diff --git a/scripts/build/lb_binary_grub2 b/scripts/build/lb_binary_grub2
index 8f076b2..b029891 100755
--- a/scripts/build/lb_binary_grub2
+++ b/scripts/build/lb_binary_grub2
@@ -68,7 +68,7 @@ Grub_live_entry ()
APPEND="${4}"
LINUX_LIVE="${LINUX_LIVE}\nmenuentry \"Debian GNU/Linux - ${LABEL}\" {"
- LINUX_LIVE="${LINUX_LIVE}\nlinux\t\t/${KERNEL} boot=${INITFS} config LB_BOOTAPPEND_LIVE ${APPEND}"
+ LINUX_LIVE="${LINUX_LIVE}\nlinux\t\t/${KERNEL} ${INITFS:+boot=${INITFS} }config LB_BOOTAPPEND_LIVE ${APPEND}"
LINUX_LIVE="${LINUX_LIVE}\ninitrd\t\t/${INITRD}"
LINUX_LIVE="${LINUX_LIVE}\n}"
}
@@ -99,6 +99,10 @@ case "${LB_INITRAMFS}" in
live-boot)
INITFS="live"
;;
+
+ *)
+ INITFS=""
+ ;;
esac
# Setting destination directory
@@ -112,6 +116,10 @@ case "${LB_BINARY_IMAGES}" in
live-boot)
DESTDIR_LIVE="binary/live"
;;
+
+ *)
+ DESTDIR_LIVE="binary/live"
+ ;;
esac
DESTDIR_INSTALL="binary/install"
diff --git a/scripts/build/lb_binary_manifest b/scripts/build/lb_binary_manifest
index 4b49133..0ae9051 100755
--- a/scripts/build/lb_binary_manifest
+++ b/scripts/build/lb_binary_manifest
@@ -53,6 +53,11 @@ case "${LB_INITRAMFS}" in
INITFS="live"
SUFFIX="packages"
;;
+
+ *)
+ INITFS="boot"
+ SUFFIX="packages"
+ ;;
esac
# Add filesystem.packages
diff --git a/scripts/build/lb_binary_memtest b/scripts/build/lb_binary_memtest
index a539ee6..8155b14 100755
--- a/scripts/build/lb_binary_memtest
+++ b/scripts/build/lb_binary_memtest
@@ -87,6 +87,10 @@ case "${LB_INITRAMFS}" in
live-boot)
DESTDIR="binary/live"
;;
+
+ *)
+ DESTDIR="binary/boot"
+ ;;
esac
Check_multiarchitectures
diff --git a/scripts/build/lb_binary_net b/scripts/build/lb_binary_net
index 9cac050..133a203 100755
--- a/scripts/build/lb_binary_net
+++ b/scripts/build/lb_binary_net
@@ -69,6 +69,10 @@ then
live-boot)
ORIGDIR="binary/live"
;;
+
+ *)
+ ORIGDIR="binary/boot"
+ ;;
esac
# Find defaults
diff --git a/scripts/build/lb_binary_rootfs b/scripts/build/lb_binary_rootfs
index 85785fc..417c381 100755
--- a/scripts/build/lb_binary_rootfs
+++ b/scripts/build/lb_binary_rootfs
@@ -56,6 +56,10 @@ case "${LB_INITRAMFS}" in
live-boot)
INITFS="live"
;;
+
+ *)
+ INITFS="boot"
+ ;;
esac
# Creating directory
diff --git a/scripts/build/lb_binary_silo b/scripts/build/lb_binary_silo
index ac2e2d0..5834a0b 100755
--- a/scripts/build/lb_binary_silo
+++ b/scripts/build/lb_binary_silo
@@ -82,7 +82,7 @@ Silo_live_entry ()
LINUX_LIVE="${LINUX_LIVE}\nimage=${DIRECTORY}/${KERNEL}\n"
LINUX_LIVE="${LINUX_LIVE}\t label=${LABEL}\n"
LINUX_LIVE="${LINUX_LIVE}\t initrd=${DIRECTORY}/${INITRD}\n"
- LINUX_LIVE="${LINUX_LIVE}\t append=\"boot=${INITFS} config LB_BOOTAPPEND_LIVE ${APPEND}\"\n"
+ LINUX_LIVE="${LINUX_LIVE}\t append=\"${INITFS:+boot=${INITFS} }config LB_BOOTAPPEND_LIVE ${APPEND}\"\n"
}
Silo_install_entry ()
@@ -117,6 +117,11 @@ case "${LB_INITRAMFS}" in
INITFS="live"
DESTDIR_LIVE="binary/live"
;;
+
+ *)
+ INITFS=""
+ DESTDIR_LIVE="binary/boot"
+ ;;
esac
# Creating directory
diff --git a/scripts/build/lb_binary_yaboot b/scripts/build/lb_binary_yaboot
index ee2452b..4613b8a 100755
--- a/scripts/build/lb_binary_yaboot
+++ b/scripts/build/lb_binary_yaboot
@@ -72,7 +72,7 @@ Yaboot_live_entry ()
LINUX_LIVE="${LINUX_LIVE}\nimage=${DIRECTORY}/${KERNEL}\n"
LINUX_LIVE="${LINUX_LIVE}\tlabel=${LABEL}\n"
LINUX_LIVE="${LINUX_LIVE}\tinitrd=${DIRECTORY}/${INITRD}\n"
- LINUX_LIVE="${LINUX_LIVE}\tappend=\"boot=${INITFS} config LB_BOOTAPPEND_LIVE ${APPEND}\"\n"
+ LINUX_LIVE="${LINUX_LIVE}\tappend=\"${INITFS:+boot=${INITFS} }config LB_BOOTAPPEND_LIVE ${APPEND}\"\n"
LINUX_LIVE="${LINUX_LIVE}\tinitrd-size=10240\n"
}
@@ -132,6 +132,10 @@ case "${LB_INITRAMFS}" in
live-boot)
INITFS="live"
;;
+
+ *)
+ INITFS=""
+ ;;
esac
# Setting destination directory
@@ -145,6 +149,10 @@ case "${LB_BINARY_IMAGES}" in
live-boot)
DESTDIR_LIVE="binary/live"
;;
+
+ *)
+ DESTDIR_LIVE="binary/boot"
+ ;;
esac
DESTDIR_INSTALL="binary/install"
diff --git a/scripts/build/lb_chroot_hacks b/scripts/build/lb_chroot_hacks
index 4c26deb..bbb39ce 100755
--- a/scripts/build/lb_chroot_hacks
+++ b/scripts/build/lb_chroot_hacks
@@ -255,9 +255,13 @@ case "${LB_INITRAMFS}" in
live-boot)
ID="1000"
;;
+
+ *)
+ ID=""
+ ;;
esac
-if [ -d chroot/home/${LB_USERNAME} ]
+if [ -d chroot/home/${LB_USERNAME} ] && [ "${ID}" ]
then
chown -R --quiet ${ID}:${ID} chroot/home/${LB_USERNAME}
fi
--
1.7.4.1
Reply to: