Merge lp:~blake-rouse/curtin/ppc64el-grub-ieee1275 into lp:~curtin-dev/curtin/trunk

Proposed by Blake Rouse
Status: Merged
Merged at revision: 127
Proposed branch: lp:~blake-rouse/curtin/ppc64el-grub-ieee1275
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 33 lines (+13/-7)
1 file modified
helpers/common (+13/-7)
To merge this branch: bzr merge lp:~blake-rouse/curtin/ppc64el-grub-ieee1275
Reviewer Review Type Date Requested Status
curtin developers Pending
Review via email: mp+215714@code.launchpad.net

Commit message

grub-ieee1275 installation on ppc64el.

Description of the change

Provides support for curtin installation on ppc64el.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

thanks.
this looks reasonable, except this:

$ sh -c 'mfunc() { local f=$(false); echo $?; }; mfunc;'
0

Ie, the 'local' declaration masks the return value so that:
local dpkg_arch=$(chroot "$mp" dpkg --print-architecture)

will always return 0.

local dpkg_arch=""
dpkg_arch=$(chroot "$mp" dpkg --print-architecture)

128. By Blake Rouse

Fix local variable.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Fixed!

129. By Blake Rouse

Fix invalid return code for dpkg_arch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'helpers/common'
2--- helpers/common 2014-04-10 18:56:53 +0000
3+++ helpers/common 2014-04-21 16:04:07 +0000
4@@ -301,16 +301,22 @@
5 fi
6 [ -b $mp_dev ] || { error "$mp_dev is not a block device!"; return 1; }
7
8+ # get dpkg arch
9+ local dpkg_arch=""
10+ dpkg_arch=$(chroot "$mp" dpkg --print-architecture)
11+ r=$?
12+ if [ $r -ne 0 ]; then
13+ error "failed to get dpkg architecture"
14+ return 1;
15+ fi
16+
17 # set correct grub package
18 local grub_name="grub-pc"
19 local grub_target="i386-pc"
20- if [ "$uefi" -ge 1 ]; then
21- dpkg_arch=$(chroot "$mp" dpkg --print-architecture)
22- r=$?
23- if [ $r -ne 0 -a $r -ne 1 ]; then
24- error "failed to get dpkg architecture"
25- return 1;
26- fi
27+ if [ "$dpkg_arch" = "ppc64el" ]; then
28+ grub_name="grub-ieee1275"
29+ grub_target="powerpc-ieee1275"
30+ elif [ "$uefi" -ge 1 ]; then
31 grub_name="grub-efi-$dpkg_arch"
32 if [ "$dpkg_arch" = "amd64" ]; then
33 grub_target="x86_64-efi"

Subscribers

People subscribed via source and target branches