[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

flash-kernel: handle DTBs in vendor subdir

DTBs on arm64 are stored as vendor/dtb rather than everything in one
directory.  flash-kernel doesn't handle this at the moment.  I see two

1) Strip the vendor dir away and install the dtb as

2) Keep the directory and install as /boot/dtbs/$kvers/vendor/dtb

In both cases, I think we should accept local DTBs in
/etc/flash-kernel/dtbs either as vendor/dtb or just dtb.

The patch below implements options 1.  Do people think this is the
right path or would you prefer option 2?

Actually, now that I look at the boot script, I think the real
question is: does ${fdtfile} from u-boot contain the directory or not?
I believe the answer is no, so option 1 is the right on.

Any problems with the proposed patch?

diff --git a/functions b/functions
index 0f597b8..06a0c39 100644
--- a/functions
+++ b/functions
@@ -560,6 +560,8 @@ find_dtb_file() {
 		if [ -e "/etc/flash-kernel/dtbs/$dtb_name" ] ; then
 			echo "/etc/flash-kernel/dtbs/$dtb_name"
+		elif [ -e "/etc/flash-kernel/dtbs/$(basename $dtb_name)" ] ; then
+			echo "/etc/flash-kernel/dtbs/$(basename $dtb_name)"
 			echo "/usr/lib/linux-image-$kvers/$dtb_name"
@@ -573,6 +575,11 @@ handle_dtb() {
 	local dtb=$(find_dtb_file)
+	# DTBs on arm64 are stored in subdirs for each vendor; strip the
+	# dir away because we want to put the file in /boot/dtbs/$kvers/
+	# without additional subdirs.
+	local dtb_name=$(basename $dtb_name)
 	if [ "x$FK_KERNEL_HOOK_SCRIPT" = "xpostrm.d" ] ; then
 		rm -f "/boot/dtbs/$kvers/$dtb_name"

Martin Michlmayr

Reply to: