lb_binary_disk doesn't check compression of the initramfs

Bug #961166 reported by Ante Karamatić
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
Critical
Unassigned
Precise
Fix Released
Critical
Unassigned
live-build (Debian)
Fix Released
Unknown
live-build (Ubuntu)
Fix Released
Critical
Unassigned
Precise
Fix Released
Critical
Łukasz Zemczak

Bug Description

[Impact]

 * Canonical OEM IBS still uses Ubuntu 12.04 to build Ubuntu OEM images for
   trusty, wily and the following xenial.

 * Without this fix, Canonical OEM IBS can not generate Ubuntu OEM images for wily and xenial.

[Test Case]

 * Please use the config in comment #7.
 * Uncompress it and execute `lb build` on Ubuntu 12.04.
 * It should be able to generate a binary.iso.

[Regression Potential]

 * None

[Other Info]

 * The fix for precise in attached in comment #6.
 * This issue only affects precise.

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.

Revision history for this message
Ante Karamatić (ivoks) wrote :
Colin Watson (cjwatson)
Changed in live-build (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "live-build.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Ante Karamatić (ivoks) wrote :

First patch was an extract from bzr tree. This patch (live-build-package.patch) applies against the packaged version.

Revision history for this message
Ante Karamatić (ivoks) wrote :

This patch includes all changes from commit 8316bd2d9813cbc7b2b8288b6618eec2c2004028 and subsequent fix for $LB_INITRAMFS_COMPRESSION.

Colin Watson (cjwatson)
Changed in live-build (Ubuntu):
assignee: Colin Watson (cjwatson) → nobody
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

There is no such issue for trusty, vivid, wily and xenial.
We only need to fix this issue for precise.

Changed in live-build (Ubuntu):
assignee: nobody → Shih-Yuan Lee (fourdollars)
tags: added: precise
Changed in live-build (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :
Download full text (4.7 KiB)

The patch contains the following commits.

From 0aab94aac9a07f450dd69e7897428b28c27879a4 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <email address hidden>
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
 <email address hidden>.

---
 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 <email address hidden>
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 <email address hidden>
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: Dan...

Read more...

Changed in oem-priority:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Shih-Yuan Lee (fourdollars)
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :
description: updated
description: updated
Changed in live-build (Ubuntu):
importance: Medium → Critical
description: updated
Changed in live-build (Ubuntu):
assignee: Shih-Yuan Lee (fourdollars) → nobody
Changed in oem-priority:
assignee: Shih-Yuan Lee (fourdollars) → nobody
status: In Progress → New
Changed in live-build (Ubuntu):
status: In Progress → New
description: updated
Mathew Hodson (mhodson)
Changed in live-build (Ubuntu Precise):
importance: Undecided → Critical
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This does not affect current development series (xenial). Only precise is affected.

Changed in live-build (Ubuntu):
status: New → Invalid
Changed in live-build (Ubuntu Precise):
assignee: nobody → Łukasz Zemczak (sil2100)
Changed in live-build (Ubuntu Precise):
status: New → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Ante, or anyone else affected,

Accepted live-build into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/live-build/3.0~a24-1ubuntu32.7 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in live-build (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Mathew Hodson (mhodson)
Changed in live-build (Ubuntu):
status: Invalid → Fix Released
Changed in live-build (Debian):
status: Unknown → Fix Released
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

I have verified https://launchpad.net/ubuntu/+source/live-build/3.0~a24-1ubuntu32.7 and it has no problem for live-build.tar.xz.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package live-build - 3.0~a24-1ubuntu32.7

---------------
live-build (3.0~a24-1ubuntu32.7) precise-proposed; urgency=low

  * debian/patches/ubuntu-initramfs-uuid.patch:
    - Fix the mechanism of extracting UUID from initrd.img. (LP: #961166)

 -- Shih-Yuan Lee (FourDollars) <email address hidden> Tue, 22 Dec 2015 14:38:21 +0800

Changed in live-build (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for live-build has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in oem-priority:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.