Merge ~heber013/ubiquity/+git/fix_initrd_unpacking:master into ubiquity:master

Proposed by Heber Parrucci
Status: Merged
Merged at revision: 92ae42f7fe44ccda2b466a27fa71e44b347e1ce5
Proposed branch: ~heber013/ubiquity/+git/fix_initrd_unpacking:master
Merge into: ubiquity:master
Diff against target: 94 lines (+19/-18)
1 file modified
autopilot/ubiquity-autopilot-runner/run-ubiquity-test (+19/-18)
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+353865@code.launchpad.net

Commit message

Fixing initrd unpacking-repacking

Description of the change

Fixing initrd unpacking-repacking

To post a comment you must log in.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Reviewed and tested on cosmic images. Looks good. Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/autopilot/ubiquity-autopilot-runner/run-ubiquity-test b/autopilot/ubiquity-autopilot-runner/run-ubiquity-test
2index 3078edf..f45ef0a 100755
3--- a/autopilot/ubiquity-autopilot-runner/run-ubiquity-test
4+++ b/autopilot/ubiquity-autopilot-runner/run-ubiquity-test
5@@ -86,7 +86,7 @@ Usage: $(basename $0) [OPTIONS...] <iso file>
6 Prepares a system from an ISO and run autopilot tests for ubiquity
7
8 Arguments:
9- <iso file> Path to a valid Ubuntu Desktop ISO
10+ <iso file> Path to a valid Ubuntu Desktop ISO
11 Options:
12 -h, --help This help
13 -d, --debug Enable debug mode
14@@ -128,7 +128,7 @@ check_prerequisites() {
15 fi
16 done
17
18- QEMUCMD=$(which qemu-system-x86_64||true)
19+ QEMUCMD=$(which qemu-system-x86_64||true)
20 if [ -z "$QEMUCMD" ]; then
21 echo "E: qemu is required and not installed on this system (run sudo apt-get install qemu). Exiting!"
22 RC=1
23@@ -140,7 +140,7 @@ check_prerequisites() {
24 }
25
26 extract_kernel() {
27- # Extract kernel and initrd
28+ # Extract kernel and initrd
29 #
30 # Extract kernel and initrd from an ISO image
31 #
32@@ -163,7 +163,7 @@ extract_kernel() {
33 exit
34 fi
35
36- files="casper/initrd.lz casper/$(basename $KERNEL)"
37+ files="casper/initrd casper/$(basename $KERNEL)"
38 echo "I: extracting files from $src: $files"
39 bsdtar xf $src -C $dst $files
40 ret=$?
41@@ -175,7 +175,7 @@ extract_kernel() {
42 }
43
44 create_disk_image() {
45- # Create a disk image
46+ # Create a disk image
47 #
48 # Args:
49 # $1: Path of the disk image to create
50@@ -205,30 +205,31 @@ prepare_initrd() {
51 # Nothing
52 workdir=$1/initrd
53 initrd=$2
54- initrdlz=${initrd}.lz
55 usercustomdir=$3
56 customdir=${BINDIR}/custom-installation
57
58 echo "I: Preparing initrd"
59- if [ ! -f "$initrdlz" ]; then
60- echo "E: file '$(basename $initrdlz)' not found. Aborting!"
61+ if [ ! -f "$initrd" ]; then
62+ echo "E: file '$(basename $initrd)' not found. Aborting!"
63 RC=1
64- exit
65+ exit
66 fi
67 mkdir -p $workdir
68
69 (
70- cd $workdir
71- xzcat $initrdlz|cpio --quiet -ivd 2>/dev/null
72+ cd $1
73+ unmkinitramfs $initrd $workdir
74 echo "I: Copying overrides"
75- cp -af $customdir $workdir/
76- [ -d "$usercustomdir" ] && cp -af "$usercustomdir" $workdir/
77- mkdir -p $workdir/custom-installation/iso-override/var/local/autopilot
78- echo "$TESTNAME" > $workdir/custom-installation/iso-override/var/local/autopilot/testsuites
79- [ -f "$TESTCONFIG" ] && cp $TESTCONFIG $workdir/custom-installation/iso-override/var/local/autopilot/config
80+ maindir=$workdir/main
81+ cd $maindir
82+ cp -af $customdir $maindir/
83+ [ -d "$usercustomdir" ] && cp -af "$usercustomdir" $maindir/
84+ mkdir -p $maindir/custom-installation/iso-override/var/local/autopilot
85+ echo "$TESTNAME" > $maindir/custom-installation/iso-override/var/local/autopilot/testsuites
86+ [ -f "$TESTCONFIG" ] && cp $TESTCONFIG $maindir/custom-installation/iso-override/var/local/autopilot/config
87 if [ -n "$SHAREDDIR" ]; then
88- echo >> $workdir/custom-installation/iso-override/var/local/autopilot/config
89- echo "SHAREDVOL=ubiquity" >> $workdir/custom-installation/iso-override/var/local/autopilot/config
90+ echo >> $maindir/custom-installation/iso-override/var/local/autopilot/config
91+ echo "SHAREDVOL=ubiquity" >> $maindir/custom-installation/iso-override/var/local/autopilot/config
92 fi
93 echo "I: Repacking initrd"
94 [ -f "$initrd" ] && rm -f $initrd

Subscribers

People subscribed via source and target branches