[Bug 961166] Re: lb_binary_disk doesn't check compression of the initramfs
Shih-Yuan Lee
961166 at bugs.launchpad.net
Tue Dec 22 07:31:35 UTC 2015
The patch contains the following commits.
>From 0aab94aac9a07f450dd69e7897428b28c27879a4 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel at debian.org>
Date: Thu, 21 Jul 2011 17:06:54 +0200
Subject: [PATCH] Calling mkdir with -p to avoid build failures with multiple
kernels on disk info in ubuntu mode, thanks to Cody A.W. Somerville
<cody.somerville at canonical.com>.
---
scripts/build/lb_binary_disk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/build/lb_binary_disk b/scripts/build/lb_binary_disk
index a28a0fe..b592b88 100755
--- a/scripts/build/lb_binary_disk
+++ b/scripts/build/lb_binary_disk
@@ -88,7 +88,7 @@ case "${LB_INITRAMFS}" in
casper)
for INITRD in binary/casper/initrd.img*
do
- mkdir uuid
+ mkdir -p uuid
cd uuid
zcat "../${INITRD}" | cpio --quiet -id conf/uuid.conf
--
1.9.1
>From 8316bd2d9813cbc7b2b8288b6618eec2c2004028 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel at debian.org>
Date: Thu, 21 Jul 2011 17:24:08 +0200
Subject: [PATCH] Correcting uuid extraction from initrds in ubuntu mode to
work from within binary so that it is cleaned up by lb_clean on failed
builds.
---
scripts/build/lb_binary_disk | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/build/lb_binary_disk b/scripts/build/lb_binary_disk
index b592b88..b1c4728 100755
--- a/scripts/build/lb_binary_disk
+++ b/scripts/build/lb_binary_disk
@@ -86,12 +86,12 @@ fi
case "${LB_INITRAMFS}" in
casper)
- for INITRD in binary/casper/initrd.img*
+ for INITRD in $(ls binary/casper/initrd.img* > /dev/null 2>&1)
do
- mkdir -p uuid
- cd uuid
+ mkdir -p binary/uuid
+ cd binary/uuid
- zcat "../${INITRD}" | cpio --quiet -id conf/uuid.conf
+ zcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
if [ -e conf/uuid.conf ]
then
@@ -100,8 +100,8 @@ case "${LB_INITRAMFS}" in
Echo_warning "Failed to find casper uuid.conf in '${INITRD}'"
fi
- cd ..
- rm -rf uuid
+ cd ${OLDPWD}
+ rm -rf binary/uuid
done
;;
esac
--
1.9.1
>From dfaa4a67b55613087cd7beb80fb386a85f1c84f8 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel at debian.org>
Date: Wed, 7 Sep 2011 14:16:05 +0200
Subject: [PATCH] Doing uuid.conf extraction from initrd with the correct
decompression utility (Closes: #637979).
---
scripts/build/lb_binary_disk | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/scripts/build/lb_binary_disk b/scripts/build/lb_binary_disk
index a7ddef2..1dc8d82 100755
--- a/scripts/build/lb_binary_disk
+++ b/scripts/build/lb_binary_disk
@@ -91,7 +91,19 @@ case "${LB_INITRAMFS}" in
mkdir -p binary/uuid
cd binary/uuid
- zcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+ case "${LB_INITRAMFS_COMPRESSION}" in
+ gzip)
+ zcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+ ;;
+
+ bzip2)
+ bzcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+ ;;
+
+ lzma)
+ lzcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+ ;;
+ esac
if [ -e conf/uuid.conf ]
then
--
1.9.1
>From 2eab8fec682e896cd5e2c1fd48386d43ce6f0139 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel at debian.org>
Date: Thu, 12 Jan 2012 11:57:45 +0100
Subject: [PATCH] Correcting wrong and incompatible loop for casper initrds in
binary_disk.
---
scripts/build/lb_binary_disk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/build/lb_binary_disk b/scripts/build/lb_binary_disk
index 96e2233..3f44a4b 100755
--- a/scripts/build/lb_binary_disk
+++ b/scripts/build/lb_binary_disk
@@ -93,7 +93,7 @@ fi
case "${LB_INITRAMFS}" in
casper)
- for INITRD in $(ls binary/casper/initrd.img* > /dev/null 2>&1)
+ for INITRD in binary/casper/initrd.img*
do
mkdir -p binary/uuid
cd binary/uuid
--
1.9.1
>From 7f91738540715f4e0d434383b03659926f7d68b1 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel at debian.org>
Date: Tue, 7 Feb 2012 10:12:52 +0100
Subject: [PATCH] Correcting destination path for uuid.conf when using casper
in binary_disk, thanks to Luigi Capriotti <l.capriotti at xbmc.org> (Closes:
#658995).
---
scripts/build/lb_binary_disk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/build/lb_binary_disk b/scripts/build/lb_binary_disk
index a845b27..e7b3216 100755
--- a/scripts/build/lb_binary_disk
+++ b/scripts/build/lb_binary_disk
@@ -114,7 +114,7 @@ case "${LB_INITRAMFS}" in
if [ -e conf/uuid.conf ]
then
- mv conf/uuid.conf "../binary/.disk/casper-uuid${INITRD#binary/casper/initrd.img}"
+ mv conf/uuid.conf "../.disk/casper-uuid${INITRD#binary/casper/initrd.img}"
else
Echo_warning "Failed to find casper uuid.conf in '${INITRD}'"
fi
--
1.9.1
** Also affects: oem-priority
Importance: Undecided
Status: New
** Changed in: oem-priority
Status: New => In Progress
** Changed in: oem-priority
Importance: Undecided => Critical
** Changed in: oem-priority
Assignee: (unassigned) => Shih-Yuan Lee (fourdollars)
** Also affects: oem-priority/precise
Importance: Undecided
Status: New
** Changed in: oem-priority/precise
Status: New => In Progress
** Changed in: oem-priority/precise
Importance: Undecided => Critical
** Changed in: oem-priority/precise
Assignee: (unassigned) => Shih-Yuan Lee (fourdollars)
** Patch added: "live-build.debdiff"
https://bugs.launchpad.net/oem-priority/+bug/961166/+attachment/4538787/+files/live-build.debdiff
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to live-build in Ubuntu.
https://bugs.launchpad.net/bugs/961166
Title:
lb_binary_disk doesn't check compression of the initramfs
Status in OEM Priority Project:
In Progress
Status in OEM Priority Project precise series:
In Progress
Status in live-build package in Ubuntu:
In Progress
Bug description:
When LB_INITRAMFS="casper", lb_binary_disk assumes initrd is
compressed with gzip. Since it can be lzma and bzip2, build process
will fail if one of those two compression methods are used. This is
fixed upstream by commits 1940 and 2105. Patch is attached.
To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/961166/+subscriptions
More information about the foundations-bugs
mailing list