#47 set PREFIX when no --target specified
Merged 4 years ago by pwhalen. Opened 4 years ago by phomes.
phomes/arm-image-installer prefix-no-target  into  master

file modified
+6 -6
@@ -445,15 +445,15 @@ 

  	sed -i 's|/dev/mapper/fedora-root|/dev/mapper/fedora--server-root|g; s|rd.lvm.lv=fedora/root|rd.lvm.lv=fedora-server/root|g' /tmp/fw/EFI/fedora/grubenv

  fi

  

+ if [ "$IOT_IMAGE" = "1" ]; then

+ 	# dd doesnt support wildcards, echo to expand

+ 	PREFIX=$(echo $OSTREE_PREFIX)

+ else

+ 	PREFIX=/tmp/root

+ fi

  

  # determine uboot and write to disk

  if [ "$TARGET" != "" ]; then

- 	if [ "$IOT_IMAGE" = "1" ]; then

- 		# dd doesnt support wildcards, echo to expand

-         	PREFIX=$(echo $OSTREE_PREFIX)

- 	else

- 		PREFIX=/tmp/root

- 	fi

  	if [ "$TARGET" = "rpi2" ] || [ "$TARGET" = "rpi3" ] || [ "$TARGET" = "olpc_xo175" ]; then

  		. "${BOARDDIR}/${TARGET}"

  	elif [ -d "${PREFIX}/usr/share/uboot/${TARGET}" ]; then

PREFIX was only set when a --target was specified. With an empty PREFIX
the following options would then affect the host system instead of the
arm image:
--norootpass
--selinux
--sysrq
--relabel

This patch set the PREFIX to /tmp/root if no --target is specified.

Maybe it makes sense just to set it unconditionally outside of the if/else statement?

rebased onto 02436d4

4 years ago

Maybe it makes sense just to set it unconditionally outside of the if/else statement?

done

or wait, did you want me to set PREFIX=/tmp/root before the if like so?

PREFIX=/tmp/root
if [ "$TARGET" != "" ]; then
    if [ "$IOT_IMAGE" = "1" ]; then
        PREFIX=$(echo $OSTREE_PREFIX)
    fi
    ....
fi

Pull-Request has been merged by pwhalen

4 years ago
Metadata