#74 Add ability to lookup devicetree images from local system
Closed 6 months ago by lorbus. Opened 3 years ago by lorbus.
lorbus/arm-image-installer patch-20210309  into  main

file modified
+12 -4
@@ -322,19 +322,22 @@ 

  	fi

  }

  

- add_bls_parameter()

- {

+ add_bls_parameter() {

  	for bls in /tmp/boot/loader/entries/*.conf; do

+ 		echo "appending kargs '$1' to BLS config fragment /boot/loader/entries/$(basename ${bls})"

  		sed -i "s|options|& $1|" ${bls}

  	done

  }

  

- add_kernel_parameter () {

+ add_kernel_parameter() {

  	if [ -f /tmp/boot/extlinux/extlinux.conf ]; then

+ 		echo "appending kargs to '$1' /boot/extlinux/extlinux.conf"

  		sed -i "s|append|& $1 |" /tmp/boot/extlinux/extlinux.conf

  	elif [ -f /tmp/fw/EFI/fedora/grub.cfg ]; then

+ 		echo "appending kargs '$1' to /etc/default/grub"

  		sed -i "s|GRUB_CMDLINE_LINUX=\"|& $1 |" ${PREFIX}/etc/default/grub

- 		if grep -q '^kernelopts=' /tmp/fw/EFI/fedora/grubenv; then

+ 		if [ -f /tmp/fw/EFI/fedora/grubenv ] && grep -q '^kernelopts=' /tmp/fw/EFI/fedora/grubenv; then

+ 			echo "appending kargs '$1' to /boot/EFI/fedora/grubenv"

  			sed -i "s|kernelopts=|& $1 |" /tmp/fw/EFI/fedora/grubenv

  		else

  			add_bls_parameter "$1"
@@ -508,6 +511,11 @@ 

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

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

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

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

+ 		echo "Warning: Using out-of-tree devicetree image for ${TARGET}. Adding to OSTree"

This appears to be a U-Boot image, and not device tree? Not sure what OSTree has got to do with it in this context.

+ 		mkdir ${PREFIX}/usr/share/uboot/${TARGET}

Why are we copying things into the /usr/share/uboot/ on the target?

+ 		cp /usr/share/uboot/${TARGET}/{idbloader.img,u-boot.itb} ${PREFIX}/usr/share/uboot/${TARGET}

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

  	else

  		echo "= No U-Boot files found for $TARGET."

  	fi

no initial comment

Can we have a proper commit message please

Why are we copying things into the /usr/share/uboot/ on the target?

This appears to be a U-Boot image, and not device tree? Not sure what OSTree has got to do with it in this context.

Over all this all appears to be useful functionality, but it appears to be doing a number of different things that don't necessarily appear to be what the commit message says. Can we break each piece of functionality into different distinct patches and ensure there's a reasonable commit message outlining what each one does.

Pull-Request has been closed by lorbus

6 months ago
Metadata