From 93621b3f647d2798fedabbaa2635e38c40e32b92 Mon Sep 17 00:00:00 2001 From: Cameron Thompson <50184035+iamromulan@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:17:23 -0400 Subject: [PATCH] Update TTYd installation -Now copies passwd from /etc to /opt/etc in the case of SELINUX is enabled on the module -Sets the root user's home folder to /usrdata/root to allow for default writability and more available space -Creates a .profile to be placed in the home directory that sets the correct $PATH This file can be used to execute a startup menu later. -Creates /usrdata/root/bin for binaries to be pushed to later. This is added to the $PATH as well by .profile --- RMxxx_rgmii_toolkit.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/RMxxx_rgmii_toolkit.sh b/RMxxx_rgmii_toolkit.sh index 08e8820..b66115e 100644 --- a/RMxxx_rgmii_toolkit.sh +++ b/RMxxx_rgmii_toolkit.sh @@ -818,8 +818,17 @@ install_ttyd() { exit 1 fi - # Replacing the login and passwd binaries + # Replacing the login and passwd binaries and set home for root to a writable directory rm /opt/etc/shadow + rm /opt/etc/passwd + cp /etc/passwd /opt/etc + mkdir /usrdata/root + mkdir /usrdata/root/bin + touch /usrdata/root/.profile + echo "# Set PATH for all shells" > /usrdata/root/.profile + echo "export PATH=/bin:/usr/sbin:/usr/bin:/sbin:/opt/sbin:/opt/bin:/usrdata/root/bin" >> /usrdata/root/.profile + chmod +x /usrdata/root/.profile + sed -i '1s|/home/root:/bin/sh|/usrdata/root:/bin/bash|' /opt/etc/passwd cp /etc/shadow /opt/etc/ rm /bin/login /usr/bin/passwd ln -sf /opt/bin/login /bin