Merge lp:~tai271828/curtinator/mr-support-cosmic into lp:~roadmr/curtinator/trunk

Proposed by Taihsiang Ho
Status: Merged
Approved by: Daniel Manrique
Approved revision: 12
Merged at revision: 11
Proposed branch: lp:~tai271828/curtinator/mr-support-cosmic
Merge into: lp:~roadmr/curtinator/trunk
Diff against target: 74 lines (+27/-5)
2 files modified
data/preseed.txt (+3/-4)
scripts/curtinator (+24/-1)
To merge this branch: bzr merge lp:~tai271828/curtinator/mr-support-cosmic
Reviewer Review Type Date Requested Status
Daniel Manrique Approve
Review via email: mp+359231@code.launchpad.net

Description of the change

Add support for Cosmic. This merge request is composed of two parts:
1. Handling the initrd. The initrd archive is created in different format from the previous releases.
2. Fix the incorrect parameter expansion of network configuration.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

+1

review: Approve
Revision history for this message
Taihsiang Ho (tai271828) wrote :

Thanks for the comments and approval!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/preseed.txt'
2--- data/preseed.txt 2018-05-02 08:10:56 +0000
3+++ data/preseed.txt 2018-11-23 09:38:38 +0000
4@@ -54,10 +54,9 @@
5 in-target apt-get clean; \
6 cp /cdrom/README.diskdefines /target; \
7 (cd /target/ && \
8- eni=etc/network/interfaces; enid="$eni.d"; \
9- [ -f $eni ] || exit 0; \
10- grep -q "source.*/${enid}" "$eni" && exit 0; \
11- { echo; echo "#curtinator added"; echo "source /$enid/*.cfg"; } >> "$eni" \
12+ [ -f etc/network/interfaces ] || exit 0; \
13+ grep -q "source.*/etc/network/interfaces.d" etc/network/interfaces && exit 0; \
14+ { echo; echo "#curtinator added"; echo "source /etc/network/interfaces.d/*.cfg"; } >> etc/network/interfaces; \
15 ); \
16 umount /target/sys; \
17 umount /target/media/cdrom; \
18
19=== modified file 'scripts/curtinator'
20--- scripts/curtinator 2018-05-02 08:10:56 +0000
21+++ scripts/curtinator 2018-11-23 09:38:38 +0000
22@@ -121,6 +121,27 @@
23 package_file $url example-preseed | gunzip -c -
24 }
25
26+function decompress_rfs_from_mixed_initrd() {
27+ local initrd=$1
28+ local initrd_decompressed_rfs_cpio=$2
29+
30+ # magic number from binwalk output of cosmic initrd
31+ dd if=$initrd bs=1605632 skip=1 | unlzma -c > $initrd_decompressed_rfs_cpio
32+}
33+
34+function compress_rfs_into_mixed_initrd() {
35+ local initrd_decompressed_rfs_cpio=$1
36+ local initrd=$2
37+
38+ local temp_rfs=$(mktemp)
39+ lzma -c $initrd_decompressed_rfs_cpio > $temp_rfs
40+ # extract microcode binaries
41+ local temp_microcode=$(mktemp)
42+ dd if=$initrd of=$temp bs=512 count=3136
43+
44+ cat $temp $temp_rfs > $initrd
45+}
46+
47 function patch_initrd() {
48 local initrd=$1; shift
49 local files=$@
50@@ -130,6 +151,7 @@
51 case $initrd in
52 *.gz) gunzip -c $initrd > $temp;;
53 *.lz) unlzma -c -S .lz $initrd > $temp;;
54+ *) decompress_rfs_from_mixed_initrd $initrd $temp;;
55 esac
56
57 echo $files | cpio --quiet -o -H newc -A -F $temp
58@@ -137,6 +159,7 @@
59 case $initrd in
60 *.gz) gzip -9 -c $temp > $initrd;;
61 *.lz) lzma -c $temp > $initrd;;
62+ *) compress_rfs_into_mixed_initrd $temp $initrd;;
63 esac
64
65 rm -f $temp
66@@ -194,7 +217,7 @@
67
68 # Extract the needed files from the ISO image.
69 DISK_INFO="/.disk/info"
70-INITRD='*/initrd.*'
71+INITRD='*/initrd*'
72 KERNEL='*/vmlinuz*'
73 PRESEED='/preseed/*'
74 echo "Extracting $ISO to $DIRECTORY"

Subscribers

People subscribed via source and target branches

to all changes: