summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorfumingwei <[email protected]>2024-03-25 14:34:09 +0800
committerfumingwei <[email protected]>2024-03-25 16:21:53 +0800
commitf946056ddd4953f2b1cf57bba3b27f7eeff117f4 (patch)
tree310a6caa3cd3bb90cd70d2ebfa5c5486d10622dd /tools
parente1647277e415899cec4fcb2d46ac2d6fab45ffb8 (diff)
feature:TSG-20052:Add OOBC function when TSG-OS first boot.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mk-base-image16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/mk-base-image b/tools/mk-base-image
index 03d76bcd..8a7ebb99 100755
--- a/tools/mk-base-image
+++ b/tools/mk-base-image
@@ -77,6 +77,22 @@ NETWORKING=yes
HOSTNAME=localhost.localdomain
EOF
+mkdir -p $target/etc/profile.d
+
+cat > $target/etc/profile.d/prompt_command.sh << EOF
+oobc_enable_file_path="/var/lib/.tsg-os-oobc-enable"
+
+read_oobc_value()
+{
+ if [ -e "\$oobc_enable_file_path" ]; then
+ echo "(OOBC) "
+ fi
+}
+PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "\${USER}" "\${HOSTNAME%%.*}" "\${PWD/#\$HOME/\~}"; PS1="[\\\u@\\\h \$(read_oobc_value)\\\W]\\\\$ "'
+EOF
+
+chmod 0755 $target/etc/profile.d/prompt_command.sh
+
# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb
# --keep-services "$target". Stolen from mkimage-rinse.sh
# locales