commit: 6a9db059ae26b4d38f12fc76ce33e41ca1d1e4bf Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> AuthorDate: Sun Aug 4 16:10:57 2019 +0000 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> CommitDate: Tue Aug 6 20:40:25 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6a9db059
linuxrc: Make shell startup output more beautiful and useful - Hide busybox version - Show genkernel version - Show running kernel version - Use emphasis (bold format) in text Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> defaults/busy-config | 2 +- defaults/initrd.scripts | 5 +++++ defaults/login-remote.sh | 22 ++++++++++++++++------ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/defaults/busy-config b/defaults/busy-config index 7830c83..39c3010 100644 --- a/defaults/busy-config +++ b/defaults/busy-config @@ -1136,7 +1136,7 @@ CONFIG_CTTYHACK=y # CONFIG_FEATURE_SH_MATH=y CONFIG_FEATURE_SH_MATH_64=y -# CONFIG_FEATURE_SH_EXTRA_QUIET is not set +CONFIG_FEATURE_SH_EXTRA_QUIET=y # CONFIG_FEATURE_SH_STANDALONE is not set # CONFIG_FEATURE_SH_NOFORK is not set CONFIG_FEATURE_SH_HISTFILESIZE=y diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 4c8955d..f27c02f 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -809,6 +809,11 @@ run_shell() { export PS1='rescueshell \w \# ' + echo + GOOD=${BLUE} good_msg "${NORMAL}Welcome to ${BOLD}${gk_ver}${NORMAL} (${gk_build_date}) ${BOLD}rescue shell${NORMAL}!" + GOOD=${BLUE} good_msg "${NORMAL}...running Linux kernel ${BOLD}${kernel_ver}${NORMAL}" + echo + if [ -n "${CONSOLE}" ] && [ -c "/dev/${CONSOLE}" ] then setsid ${SH} -c "exec sh --login </dev/${CONSOLE} >/dev/${CONSOLE} 2>&1" diff --git a/defaults/login-remote.sh b/defaults/login-remote.sh index 7f711da..f8c4d08 100644 --- a/defaults/login-remote.sh +++ b/defaults/login-remote.sh @@ -66,23 +66,33 @@ then exit 1 esac else + gk_ver="$(cat /etc/build_id)" + gk_build_date="$(cat /etc/build_date)" + kernel_ver="$(uname -r)" + export PS1='remote rescueshell \w \# ' touch "${GK_SSHD_LOCKFILE}" - good_msg "The lockfile '${GK_SSHD_LOCKFILE}' was created." - good_msg "In order to resume boot process, run 'resume-boot'." - good_msg "Be aware that it will kill your connection which means" - good_msg "you will no longer be able work in this shell." + + GOOD=${BLUE} good_msg "${NORMAL}Welcome to ${BOLD}${gk_ver}${NORMAL} (${gk_build_date}) ${BOLD}remote rescue shell${NORMAL}!" + GOOD=${BLUE} good_msg "${NORMAL}...running Linux kernel ${BOLD}${kernel_ver}${NORMAL}" + echo + good_msg "${NORMAL}The lockfile '${BOLD}${GK_SSHD_LOCKFILE}${NORMAL}' was created." + good_msg "${NORMAL}In order to resume boot process, run '${BOLD}resume-boot${NORMAL}'." + good_msg "${NORMAL}Be aware that it will kill your connection which means" + good_msg "${NORMAL}you will no longer be able to work in this shell." if [ -n "${CRYPT_ROOT}" -a ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ] then - good_msg "To remote unlock LUKS-encrypted root device, run 'unlock-luks root'." + good_msg "${NORMAL}To remote unlock LUKS-encrypted root device, run '${BOLD}unlock-luks root${NORMAL}'." fi if [ -n "${CRYPT_SWAP}" -a ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ] then - good_msg "To remote unlock LUKS-encrypted swap device, run 'unlock-luks swap'." + good_msg "${NORMAL}To remote unlock LUKS-encrypted swap device, run '${BOLD}unlock-luks swap${NORMAL}'." fi + echo + [ -x /bin/sh ] && SH=/bin/sh || SH=/bin/ash exec ${SH} --login fi