diff --git a/functions b/functions index 2e9b280..bc78e02 100644 --- a/functions +++ b/functions @@ -21,6 +21,7 @@ BOOTSCRIPTS_DIR="${FK_CHECKOUT:-$FK_DIR}/bootscript" MACHINE_DB="$(cat "${FK_CHECKOUT:-$FK_DIR}/db/"*.db)" PROC_CPUINFO="/proc/cpuinfo" +PROC_DEVICETREE_MODEL="/proc/device-tree/model" PROC_MTD="/proc/mtd" @@ -99,6 +100,10 @@ get_cpuinfo_hardware() { grep "^Hardware" "$PROC_CPUINFO" | sed 's/Hardware\s*:\s*//' } +get_devicetree_model() { + cat "$PROC_DEVICETREE_MODEL" +} + get_kfile_suffix() { local kfile="$1" @@ -304,6 +309,23 @@ if [ "x$1" = "x--machine" ]; then shift 2 else machine="$(get_cpuinfo_hardware)" + if [ -n "`echo $machine | grep -i 'device tree'`" ]; then + machine="$(get_devicetree_model)" + fi + if ! check_supported "$machine"; then + machine="$(get_cpuinfo_hardware)" + fi + # For DeviceTree (DT) platforms we check also for exact board model + # cause sometimes kernel could be same but method of it's + # installation vary between devices. + # + # This way we can support "Umba 3" device with their SoC kernel but + # handle installation in other way than on "UmbaUmba 17" one (which + # is fine with method used for this DT platform so does not have own + # entry in database). + # + # This also helps for DT platforms where we have separated kernels + # for same SoC devices (like Chromebook & Andale). fi if [ "x$1" = "x--supported" ]; then