From a34783228949dbca4bee13033f70cdee64ad9a66 Mon Sep 17 00:00:00 2001 From: root Date: Jun 27 2019 07:37:45 +0000 Subject: New option --sysrq. --- diff --git a/arm-image-installer b/arm-image-installer index 90b5aea..ef612ff 100755 --- a/arm-image-installer +++ b/arm-image-installer @@ -17,6 +17,7 @@ Usage: $(basename ${0}) --image=IMAGE - xz compressed image file name --media=DEVICE - media device file (/dev/[sdX|mmcblkX]) --norootpass - Remove the root password + --sysrq - Enable System Request debugging of the kernel --resizefs - Resize root filesystem to fill media device --supported - List of supported hardware --target=TARGET - target board @@ -103,6 +104,9 @@ while [ $# -gt 0 ]; do --norootpass) NOROOTPASS=1 ;; + --sysrq) + SYSRQ=1 + ;; --resizefs) RESIZEFS=1 ;; @@ -222,6 +226,10 @@ fi if [ "$NOROOTPASS" != "" ]; then echo "= Root Password will be removed." fi +# Enable System Request debugging of the kernel +if [ "$SYSRQ" != "" ]; then + echo "= System Request debugging of the kernel will be enabled." +fi # Resize root filesystem to fill media device if [ "$RESIZEFS" != "" ]; then echo "= Root partition will be resized" @@ -461,6 +469,14 @@ if [ "$NOROOTPASS" = "1" ]; then echo "= Removing the root password." sed -i 's/root:x:/root::/' /tmp/root/etc/passwd fi +# Enable System Request debugging of the kernel +if [ "$SYSRQ" != "" ]; then + echo "= Enabling System Request debugging of the kernel." + cat >> /tmp/root/etc/sysctl.d/arm-image-installer-sysrq.conf <<-EOH + # Controls the System Request debugging functionality of the kernel + kernel.sysrq = 1 + EOH +fi # Add ssh key to the image if [ "$SSH_KEY" != "" ]; then if [ -f $SSH_KEY ]; then