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

Bug#783073: marked as done (bootscripts: Support using fdtfile variable passed from u-boot)



Your message dated Sun, 07 Jun 2015 12:19:34 +0000
with message-id <E1Z1ZY6-0002EC-7U@franck.debian.org>
and subject line Bug#783073: fixed in flash-kernel 3.41
has caused the Debian Bug report #783073,
regarding bootscripts: Support using fdtfile variable passed from u-boot
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
783073: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783073
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: flash-kernel
Version: 3.35
Severity: wishlist
Tags: patch

The following patch prefers the use of the dtb file identified by the
u-boot variable ${fdtfile}, which makes it easier to support installs
where a single u-boot image can support multiple boards, but need to
load different fdt files at boot.

It essentially makes a second copy of the .dtb file in
/boot/dtbs-${kver}/${fdtfile}. Ideally, it would copy all of the .dtb
files (to support the widest number of boards), but that should be
made conditional for resource-constrained systems, so I started off
with simply making a second copy.

The various boot scripts which may include ${fdtfile} are patched to
prefer ${fdtfile}, falling back to the old behavior of the hard-coded
fdt file path.

I don't expect to see this in jessie, but hopefully something like this
could be considered for jessie+1.

diff --git a/bootscript/bootscr.beaglebone b/bootscript/bootscr.beaglebone
index 1d079f8..3e16974 100644
--- a/bootscript/bootscr.beaglebone
+++ b/bootscript/bootscr.beaglebone
@@ -20,7 +20,8 @@ kvers='@@KERNEL_VERSION@@'
 for pathprefix in ${image_locations}
 do
   load ${device} ${partition} ${loadaddr} ${pathprefix}vmlinuz-${kvers} \
-  && load ${device} ${partition} ${fdtaddr} ${pathprefix}dtb-${kvers} \
+  && load ${device} ${partition} ${fdtaddr} ${pathprefix}dtbs-${kvers}/${fdtfile} \
+  || load ${device} ${partition} ${fdtaddr} ${pathprefix}dtb-${kvers} \
   && load ${device} ${partition} ${rdaddr} ${pathprefix}initrd.img-${kvers} \
   && echo "Booting Debian ${kvers} from ${device} ${partition}..." \
   && bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr}
diff --git a/bootscript/bootscr.cubox-i b/bootscript/bootscr.cubox-i
index adeb0d2..62e5c5d 100644
--- a/bootscript/bootscr.cubox-i
+++ b/bootscript/bootscr.cubox-i
@@ -19,7 +19,8 @@ kvers='@@KERNEL_VERSION@@'
 for pathprefix in ${image_locations}
 do
   load ${device} ${partition} ${loadaddr} ${pathprefix}vmlinuz-${kvers} \
-  && load ${device} ${partition} ${fdt_addr} ${pathprefix}dtb-${kvers} \
+  && load ${device} ${partition} ${fdt_addr} ${pathprefix}dtbs-${kvers}/${fdtfile} \
+  || load ${device} ${partition} ${fdt_addr} ${pathprefix}dtb-${kvers} \
   && load ${device} ${partition} ${ramdiskaddr} ${pathprefix}initrd.img-${kvers} \
   && echo "Booting Debian ${kvers} from ${device} ${partition}..." \
   && bootz ${loadaddr} ${ramdiskaddr}:${filesize} ${fdt_addr}
diff --git a/bootscript/bootscr.sunxi b/bootscript/bootscr.sunxi
index e64010f..004ff64 100644
--- a/bootscript/bootscr.sunxi
+++ b/bootscript/bootscr.sunxi
@@ -45,10 +45,10 @@ do
   if test -e ${device} ${partition} ${pathprefix}vmlinuz-${kvers}
   then
     load ${device} ${partition} ${kernel_addr_r} ${pathprefix}vmlinuz-${kvers} \
-    && load ${device} ${partition} ${fdt_addr_r} ${pathprefix}dtb-${kvers} \
+    && load ${device} ${partition} ${fdt_addr_r} ${pathprefix}dtbs-${kvers}/${fdtfile} \
+    || load ${device} ${partition} ${fdt_addr_r} ${pathprefix}dtb-${kvers} \
     && load ${device} ${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img-${kvers} \
     && echo "Booting Debian ${kvers} from ${device} ${partition}..." \
     && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
   fi
 done
-
diff --git a/bootscript/bootscr.uboot-generic b/bootscript/bootscr.uboot-generic
index 7451112..7342377 100644
--- a/bootscript/bootscr.uboot-generic
+++ b/bootscript/bootscr.uboot-generic
@@ -17,7 +17,8 @@ setenv bootargs ${bootargs} @@LINUX_KERNEL_CMDLINE@@
 @@UBOOT_ENV_EXTRA@@
 
 load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} ${prefix}vmlinuz \
-&& load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${prefix}dtb \
+&& load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${prefix}dtbs/${fdtfile} \
+|| load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${prefix}dtb \
 && load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} ${prefix}initrd.img \
 && echo "Booting Debian..." \
 && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
diff --git a/bootscript/bootscr.wandboard b/bootscript/bootscr.wandboard
index cd04a90..39bd25e 100644
--- a/bootscript/bootscr.wandboard
+++ b/bootscript/bootscr.wandboard
@@ -22,7 +22,8 @@ kvers='@@KERNEL_VERSION@@'
 for pathprefix in ${image_locations}
 do
   load ${device} ${partition} ${loadaddr} ${pathprefix}vmlinuz-${kvers} \
-  && load ${device} ${partition} ${fdt_addr} ${pathprefix}dtb-${kvers} \
+  && load ${device} ${partition} ${fdt_addr} ${pathprefix}dtbs-${kvers}/${fdtfile} \
+  || load ${device} ${partition} ${fdt_addr} ${pathprefix}dtb-${kvers} \  
   && load ${device} ${partition} ${ramdiskaddr} ${pathprefix}initrd.img-${kvers} \
   && echo "Booting Debian ${kvers} from ${device} ${partition}..." \
   && bootz ${loadaddr} ${ramdiskaddr}:${filesize} ${fdt_addr}
diff --git a/functions b/functions
index a7ff6de..fc2c21b 100644
--- a/functions
+++ b/functions
@@ -420,13 +420,18 @@ handle_dtb() {
 
 	local dtb="/usr/lib/linux-image-$kvers/$dtb_id"
 	if [ "x$FK_KERNEL_HOOK_SCRIPT" = "xpostrm.d" ] ; then
-		rm -f "/boot/dtb-$kvers"
+		rm -f "/boot/dtb-$kvers" "/boot/dtbs-$kvers"
 	else
 		if [ -e $dtb ]; then
 			echo "Installing $dtb_id into /boot/dtb-$kvers" >&2
 			cp "$dtb" "/boot/dtb-$kvers.new"
 			backup_and_install "/boot/dtb-$kvers.new" "/boot/dtb-$kvers"
 			ln -nfs "dtb-$kvers" "/boot/dtb"
+			echo "Installing $dtb_id into /boot/dtbs-$kvers/$dtb_id" >&2
+			mkdir -p /boot/dtbs-$kvers/
+			cp "$dtb" "/boot/dtbs-$kvers/$dtb_id.new"
+			backup_and_install "/boot/dtbs-$kvers/$dtb_id.new" "/boot/dtbs-$kvers/"
+			ln -nfs "dtbs-$kvers" "/boot/dtbs"
 		else
 			echo "$dtb not found" >&2
 		fi


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: flash-kernel
Source-Version: 3.41

We believe that the bug you reported is fixed in the latest version of
flash-kernel, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 783073@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ian Campbell <ijc@debian.org> (supplier of updated flash-kernel package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 07 Jun 2015 12:29:42 +0100
Source: flash-kernel
Binary: flash-kernel flash-kernel-installer
Architecture: source
Version: 3.41
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Ian Campbell <ijc@debian.org>
Description:
 flash-kernel - utility to make certain embedded devices bootable
 flash-kernel-installer - Make the system bootable (udeb)
Closes: 783073 783074
Changes:
 flash-kernel (3.41) unstable; urgency=medium
 .
   * Improvements to generic u-boot boot script, based on a patch from Vagrant
     Cascadian (Closes: #783074):
     - If ${console} is set then add "console=${console}" to the bootargs.
     - Boot the kernel using the versioned filenames in preference to the
       generic symlinks.
     - Log which kernel (if known) and device we are booting from.
     - Workaround lack of baudrate included with console on various iMX
       system.
   * Install dtbs into /boot/dtbs/$kvers. Based on a patch from Vagrant
     Cascadian. Retain links at /boot/dtb and /boot/dtb-$kvers (Closes: #783073)
   * Switch boot scripts using $kvers to boot a specific kernel (rather than via
     the vmlinuz symlink) to prefer ${fk_kvers} if set in the environment,
     allowing a rudimentary ability to select which kernel to boot.
Checksums-Sha1:
 0b6580f416128ca1a7e31becdfdec42690390c33 1857 flash-kernel_3.41.dsc
 347ba6ababaee6213093fe4bb1768bf12b00cb39 60216 flash-kernel_3.41.tar.xz
Checksums-Sha256:
 3371fe991757dede75e9fda5515feb849df104031e49b3532bcf911accbb9e57 1857 flash-kernel_3.41.dsc
 25f5a44575de5f8ad9e67484fe971f76ef8f6bf13aaa686340f7ebb27b92dc68 60216 flash-kernel_3.41.tar.xz
Files:
 c8a5287d9ad8ebad6f6b5f4b48c4edac 1857 utils optional flash-kernel_3.41.dsc
 aae8dc592c9432fe901e5442229d018b 60216 utils optional flash-kernel_3.41.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVdCtBAAoJECouJZ9pWkbGvg4P/RZ0a6dHiFqXRck3gV4XI5Kn
W40AdASCVwK4Pyy9/SI0tFDs/Qo3EfwdqVvZjkfzDYtzbgB+wfvVq+2v5wnvCFsd
p6KZC5zVIFrIPKYtFmVgsoqQmiPKaITYIKENkYl1e4bR/YiSONKiiSBg1opPUqq8
+gzjD+h75kYvAoWOvtbl71/+AeJNomuddVm525DVaDYjvuU9vjRNa0eMCnb761uX
lgaJhdSAQ7bPzeZKgsCFrHQ/1F9s63YJ1JjSkfzPNfstwJSqHWVKSPs5tyh6eZce
wKu2xvxmyJg65ztPbaoR4TmuXUQTHUk+NiY875NHAxwHACdsM14PTqtyxpJ2lj69
PXO8SwKgNWe/e1OAe8yUD3PC+M0UzPJ2fO4Cy474+eaNYxoPwTulXZ6YXNXyyO1n
dBjvs8NToQS9KEb3Ju9J0we7oHz2MLMLI4qj/uxRndlxpU54+ST2k5ncCASJEg8D
7jsqJueEIxEqS5YC+VaEy8N+FUG8wjam4Oj+CPRwi0jUxD3UJBVa4nXX4zJ0JfGe
n7TpjUBnELKic4ZbYOE2AjZf+vk+DA07A+GlTv7IEATEqQw/5lPht58u1qOzRi3q
NPI6V+/SgKQ2lkdbRcSRmjHrEubR1LzA3zGVF2RqAW+HW4OvwRyX5OajFr46I+CL
P5xBZFhFAMHlU+6ntXuY
=jG+o
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: