hvk: check for extlinux support
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 14 Mar 2024 16:35:45 +0000 (12:35 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 14 Mar 2024 16:35:45 +0000 (12:35 -0400)
scripts/hvk-compile.sh

index 6505651..f2b6cab 100755 (executable)
@@ -99,8 +99,13 @@ if [ "${EVK_IP}" != "" ]; then
         rm /tmp/modules.tar.gz
     fi
 
-    # Switch to latest kernel and DTB:
-    ssh root@${EVK_IP} "sed -i -e 's@^DEFAULT.*@DEFAULT test@' /boot/extlinux/extlinux.conf"
+    # Determine if using extlinux on target:
+    ssh -q root@${EVK_IP} [[ -f /boot/extlinux/extlinux.conf ]] && EXTLINUX=1 || EXTLINUX=0;
+
+    if [ "${EXTLINUX}" = "1" ]; then
+        # Switch to latest kernel and DTB:
+        ssh root@${EVK_IP} "sed -i -e 's@^DEFAULT.*@DEFAULT test@' /boot/extlinux/extlinux.conf"
+    fi
 
     if [ x"${reboot}" = x"1" ]; then
         ssh root@${EVK_IP} "reboot"