From 5356c3d5cd2a625840599f59f21c4088e150ae00 Mon Sep 17 00:00:00 2001
From: Daniil Baturin <daniil@baturin.org>
Date: Sun, 14 Apr 2019 10:51:56 +0200
Subject: T1273: add an kernel command line option to enable debugging on boot.

---
 scripts/vyatta-boot-config-loader | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'scripts')

diff --git a/scripts/vyatta-boot-config-loader b/scripts/vyatta-boot-config-loader
index aead348..b445d9e 100755
--- a/scripts/vyatta-boot-config-loader
+++ b/scripts/vyatta-boot-config-loader
@@ -15,7 +15,14 @@ do_log () {
 }
 
 do_commit () {
-  $COMMIT "$@" >>$COMMIT_LOG
+  # Check if debug is enabled in the kernel command line
+  if [ ! grep vyos-debug /proc/cmdline > /dev/null ]; then
+    debug=""
+  else
+    debug="yes"
+  fi
+
+  VYOS_DEBUG=$debug $COMMIT "$@" >>$COMMIT_LOG
 }
 
 trace () {
-- 
cgit v1.2.3