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
=== modified file 'helpers/common'
--- helpers/common 2014-04-10 18:56:53 +0000
+++ helpers/common 2014-04-21 16:04:07 +0000
@@ -301,16 +301,22 @@
301 fi301 fi
302 [ -b $mp_dev ] || { error "$mp_dev is not a block device!"; return 1; }302 [ -b $mp_dev ] || { error "$mp_dev is not a block device!"; return 1; }
303303
304 # get dpkg arch
305 local dpkg_arch=""
306 dpkg_arch=$(chroot "$mp" dpkg --print-architecture)
307 r=$?
308 if [ $r -ne 0 ]; then
309 error "failed to get dpkg architecture"
310 return 1;
311 fi
312
304 # set correct grub package313 # set correct grub package
305 local grub_name="grub-pc"314 local grub_name="grub-pc"
306 local grub_target="i386-pc"315 local grub_target="i386-pc"
307 if [ "$uefi" -ge 1 ]; then316 if [ "$dpkg_arch" = "ppc64el" ]; then
308 dpkg_arch=$(chroot "$mp" dpkg --print-architecture)317 grub_name="grub-ieee1275"
309 r=$?318 grub_target="powerpc-ieee1275"
310 if [ $r -ne 0 -a $r -ne 1 ]; then319 elif [ "$uefi" -ge 1 ]; then
311 error "failed to get dpkg architecture"
312 return 1;
313 fi
314 grub_name="grub-efi-$dpkg_arch"320 grub_name="grub-efi-$dpkg_arch"
315 if [ "$dpkg_arch" = "amd64" ]; then321 if [ "$dpkg_arch" = "amd64" ]; then
316 grub_target="x86_64-efi"322 grub_target="x86_64-efi"

Subscribers

People subscribed via source and target branches