From 36dc1b7a2ea44321a2c233fd7ea576ed516d4ccc Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Fri, 1 Dec 2023 21:39:58 -0600
Subject: Add 'rootshell' key to determine root's shell

* Key added to code and documentation.
* Tests added and pass locally on gwyn (ppc64) and fran (aarch64).
* Qt UI automatically sets /bin/zsh as root's shell (ref: packages#206).
* ISO image creator backend no longer has root shell hack.
---
 devel/requirements/3b_runner.xml | 16 ++++++++++++++++
 devel/script/2_keys.xml          | 31 +++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

(limited to 'devel')

diff --git a/devel/requirements/3b_runner.xml b/devel/requirements/3b_runner.xml
index b5e9848..9ab06bd 100644
--- a/devel/requirements/3b_runner.xml
+++ b/devel/requirements/3b_runner.xml
@@ -378,6 +378,14 @@
                     <title>Runner.Validate.usergroups.Group</title>
                     <para>The system shall verify that each group specified is a valid system-defined group name that is present in the base system image <filename>/etc/group</filename> file.</para>
                 </formalpara>
+                <formalpara id="Runner.Validate.rootshell">
+                    <title>Runner.Validate.rootshell</title>
+                    <para>The system shall verify that the HorizonScript contains zero or one <literal>rootshell</literal> key.</para>
+                </formalpara>
+                <formalpara id="Runner.Validate.rootshell.Format">
+                    <title>Runner.Validate.rootshell.Format</title>
+                    <para>The system shall verify that the value of the <literal>rootshell</literal> key, if present, begins with a <literal>/</literal>.</para>
+                </formalpara>
                 <formalpara id="Runner.Validate.diskid">
                     <title>Runner.Validate.diskid</title>
                     <para>The system shall verify any <literal>diskid</literal> keys contained in the HorizonScript.</para>
@@ -828,6 +836,14 @@
                     <title>Runner.Execute.svcenable.AddlRunlevels</title>
 		    <para>If a runlevel not defined by the system service manager is specified in a <literal>svcenable</literal> key, it shall be interpreted to be a stacked runlevel atop the default runlevel and shall be configured as such in the target namespace.</para>
                 </formalpara>
+                <formalpara id="Runner.Execute.rootshell">
+                    <title>Runner.Execute.rootshell</title>
+                    <para>If a <literal>rootshell</literal> key is specified in the HorizonScript, the system shall set the shell of the <literal>root</literal> user to the value specified.</para>
+                </formalpara>
+                <formalpara id="Runner.Execute.rootshell.Exists">
+                    <title>Runner.Execute.rootshell.Exists</title>
+                    <para>If the <literal>rootshell</literal> key specifies a file that does not exist or is not executable, the system shall set the shell of the <literal>root</literal> user to the value<literal>/bin/sh</literal>.</para>
+                </formalpara>
                 <formalpara id="Runner.Execute.bootloader">
                     <title>Runner.Execute.bootloader</title>
                     <para>If a <literal>bootloader</literal> key is specified in the HorizonScript, the system shall perform the requested bootloader configuration.</para>
diff --git a/devel/script/2_keys.xml b/devel/script/2_keys.xml
index bd8469c..854f0d5 100644
--- a/devel/script/2_keys.xml
+++ b/devel/script/2_keys.xml
@@ -695,6 +695,37 @@ signingkey https://packages/builder@ourcompany.net.pub
                 </para>
             </formalpara>
         </section>
+        <section id="rootshell">
+            <title><literal>rootshell</literal></title>
+            <formalpara id="rootshell.name">
+                <title>Name</title>
+                <para><literal>rootshell</literal></para>
+            </formalpara>
+            <formalpara id="rootshell.purpose">
+                <title>Purpose</title>
+                <para>The <literal>rootshell</literal> key specifies the shell to use when logging in to the target computer as the <literal>root</literal> user.</para>
+            </formalpara>
+            <formalpara id="rootshell.format">
+                <title>Format</title>
+                <para>The <literal>rootshell</literal> key is a single string value containing the full path inside the target to the executable to use as the shell.</para>
+            </formalpara>
+            <formalpara id="rootshell.default">
+                <title>Default</title>
+                <para>If no <literal>rootshell</literal> key is specified, the target computer will use <literal>/bin/sh</literal> as the shell when logging in as the <literal>root</literal> user.</para>
+            </formalpara>
+            <formalpara id="rootshell.example">
+                <title>Example</title>
+                <para>
+                    <example>
+                        <title>The <literal>rootshell</literal> Key</title>
+                        <programlisting>
+                            rootshell /bin/zsh
+                        </programlisting>
+                        <para>This will configure the target computer to use <literal>/bin/zsh</literal> as the shell when logging in as the <literal>root</literal> user.</para>
+                    </example>
+                </para>
+            </formalpara>
+        </section>
         <section id="bootloader">
             <title><literal>bootloader</literal></title>
             <formalpara id="bootloader.name">
-- 
cgit v1.2.3-70-g09d2