Merge lp:~smoser/maas-images/trunk.img2squash-fixes into lp:maas-images

Proposed by Scott Moser on 2018-09-19
Status: Merged
Merged at revision: 412
Proposed branch: lp:~smoser/maas-images/trunk.img2squash-fixes
Merge into: lp:maas-images
Diff against target: 48 lines (+5/-5)
1 file modified
bin/img2squashfs (+5/-5)
To merge this branch: bzr merge lp:~smoser/maas-images/trunk.img2squash-fixes
Reviewer Review Type Date Requested Status
Newell Jensen (community) 2018-09-19 Approve on 2018-09-20
Review via email: mp+355364@code.launchpad.net

Commit message

img2squashfs: fix when 'image' was a directory.

This fixes img2squashfs for both '--format=dir' and --format=auto
(the default) when input is a directory.

Now the following works:
 img2squashfs my-dir/ /tmp/my-squashfs

To post a comment you must log in.
Newell Jensen (newell-jensen) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/img2squashfs'
2--- bin/img2squashfs 2017-05-11 14:52:01 +0000
3+++ bin/img2squashfs 2018-09-19 21:01:03 +0000
4@@ -91,7 +91,7 @@
5 [ "$fmt" != "auto" ] && _RET="$fmt" && return 0
6 if [ -d "$input" ]; then
7 debug 1 "${input} is a directory";
8- _RET="$dir"
9+ _RET="dir"
10 return
11 fi
12 fout=$(LANG=C file "$input") ||
13@@ -127,7 +127,7 @@
14
15 get_usable_input() {
16 # given 'input' in format 'fmt' return:
17- # _RET_fmt: the format of _RET_PATH. either
18+ # _RET_fmt: the format of _RET_path. either
19 # fs-image : a mountable filesystem image.
20 # dir : a directory
21 # _RET_path: full path to a file in tempd
22@@ -151,7 +151,7 @@
23 return;;
24 squashfs-image)
25 _RET_fmt="squashfs-image"
26- _RET_PATH="${tempd}/fs-image"
27+ _RET_path="${tempd}/fs-image"
28 ln -s "$(readlink -f "$input")" "${tempd}/fs-image"
29 return;;
30 root-tar)
31@@ -169,7 +169,7 @@
32 ;;
33 dir)
34 _RET_fmt="dir"
35- _RET_PATH="${tempd}/fs-dir"
36+ _RET_path="${tempd}/fs-dir"
37 ln -s "$(readlink -f "$input")" "${tempd}/fs-dir"
38 return;;
39 *)
40@@ -270,7 +270,7 @@
41 elif [ -f "$tpath" ]; then
42 fsimage2squashfs "$tpath" "$output" "$owner" || return
43 elif [ -d "$tpath" ]; then
44- dir2squashfs "$tpath" "$output" || return
45+ dir2squashfs "$tpath/" "$output" || return
46 else
47 error "failed. path='$tpath' cfmt=${cfmt}"
48 return 1

Subscribers

People subscribed via source and target branches