--- a/db/all.db 2013-05-14 09:26:58.000000000 +0200 +++ b/db/all.db 2013-09-09 16:07:51.737455776 +0200 @@ -241,6 +241,23 @@ Boot-Script-Path: preEnv.txt Required-Packages: u-boot-tools Bootloader-sets-root: yes +DTB-Kernel-Version: 3.11 +DTB-Id: omap4-panda-es.dtb + +Machine: TI OMAP4 PandaBoard +Method: generic +U-Boot-Kernel-Address: 0x80008000 +U-Boot-Initrd-Address: 0x0 +U-Boot-Script-Address: 0x0 +U-Boot-Script-Name: uEnvtxt.omap +Boot-Device: /dev/mmcblk0p1 +Boot-Kernel-Path: uImage +Boot-Initrd-Path: uInitrd +Boot-Script-Path: preEnv.txt +Required-Packages: u-boot-tools +Bootloader-sets-root: yes +DTB-Kernel-Version: 3.11 +DTB-Id: omap4-panda-es.dtb Machine: QNAP TS-109/TS-209 Kernel-Flavors: orion5x --- a/functions 2013-05-14 09:26:58.000000000 +0200 +++ b/functions 2013-09-09 16:08:16.501615933 +0200 @@ -179,6 +179,17 @@ } >"$output" } +append_dtb() { + local kernel="$1" + local dtb="$2" + local output="$3" + + { + cat "$kernel" + cat "$dtb" + } >"$output" +} + flash_kernel() { local input_file="$1" local output_mtd="$2" @@ -378,6 +389,8 @@ method="$(get_machine_field "$machine" "Method")" || method="generic" mtd_kernel="$(get_machine_field "$machine" "Mtd-Kernel")" || : mtd_initrd="$(get_machine_field "$machine" "Mtd-Initrd")" || : +dtb_name="$(get_machine_field "$machine" "DTB-Id")" || : +dtb_kver="$(get_machine_field "$machine" "DTB-Kernel-Version")" || : ukaddr="$(get_machine_field "$machine" "U-Boot-Kernel-Address")" || : uiaddr="$(get_machine_field "$machine" "U-Boot-Initrd-Address")" || : umaddr="$(get_machine_field "$machine" "U-Boot-Multi-Address")" || : @@ -470,6 +483,18 @@ gen_kernel "$kernel" "$tmpdir/kernel" "$machine_id" kernel="$tmpdir/kernel" fi + if [ -n "dtb_kver" ]; then + _kvers="$(echo "$kvers" | awk -F'.' '{ print $1$2 }')" + _dtb_kver="$(echo "$dtb_kver" | awk -F'.' '{ print $1$2 }')" + if [ "$_kvers" -ge "$_dtb_kver" ]; then + dtb="/lib/firmware/$kvers/device-tree/$dtb_name" + if [ ! -f "$dtb" ] ; then + error "Couldn't find $dtb" + fi + append_dtb "$kernel" "$dtb" "$tmpdir/kernel" + kernel="$tmpdir/kernel" + fi + fi if [ -n "$ukaddr" ]; then mkimage_kernel "$ukaddr" "$desc" "$kernel" \ "$tmpdir/uImage" --- a/README 2013-04-04 12:06:37.000000000 +0200 +++ b/README 2013-09-10 10:10:42.621160576 +0200 @@ -128,3 +128,6 @@ kernel, initrd and U-Boot script; Boot-Kernel-Path, Boot-Initrd-Path and Boot-Script-Path are then taken relative to this boot device +* DTB-Kernel-Version: (optional) minimal kernel version for DTB concatenation + +* DTB-Id: (optional) specifies the name of the DTB file for this device