Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/
Date: Wed, 07 Aug 2019 15:46:13
Message-Id: 1565124025.6a9db059ae26b4d38f12fc76ce33e41ca1d1e4bf.whissi@gentoo
1 commit: 6a9db059ae26b4d38f12fc76ce33e41ca1d1e4bf
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 4 16:10:57 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 6 20:40:25 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6a9db059
7
8 linuxrc: Make shell startup output more beautiful and useful
9
10 - Hide busybox version
11
12 - Show genkernel version
13
14 - Show running kernel version
15
16 - Use emphasis (bold format) in text
17
18 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
19
20 defaults/busy-config | 2 +-
21 defaults/initrd.scripts | 5 +++++
22 defaults/login-remote.sh | 22 ++++++++++++++++------
23 3 files changed, 22 insertions(+), 7 deletions(-)
24
25 diff --git a/defaults/busy-config b/defaults/busy-config
26 index 7830c83..39c3010 100644
27 --- a/defaults/busy-config
28 +++ b/defaults/busy-config
29 @@ -1136,7 +1136,7 @@ CONFIG_CTTYHACK=y
30 #
31 CONFIG_FEATURE_SH_MATH=y
32 CONFIG_FEATURE_SH_MATH_64=y
33 -# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
34 +CONFIG_FEATURE_SH_EXTRA_QUIET=y
35 # CONFIG_FEATURE_SH_STANDALONE is not set
36 # CONFIG_FEATURE_SH_NOFORK is not set
37 CONFIG_FEATURE_SH_HISTFILESIZE=y
38
39 diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
40 index 4c8955d..f27c02f 100644
41 --- a/defaults/initrd.scripts
42 +++ b/defaults/initrd.scripts
43 @@ -809,6 +809,11 @@ run_shell() {
44
45 export PS1='rescueshell \w \# '
46
47 + echo
48 + GOOD=${BLUE} good_msg "${NORMAL}Welcome to ${BOLD}${gk_ver}${NORMAL} (${gk_build_date}) ${BOLD}rescue shell${NORMAL}!"
49 + GOOD=${BLUE} good_msg "${NORMAL}...running Linux kernel ${BOLD}${kernel_ver}${NORMAL}"
50 + echo
51 +
52 if [ -n "${CONSOLE}" ] && [ -c "/dev/${CONSOLE}" ]
53 then
54 setsid ${SH} -c "exec sh --login </dev/${CONSOLE} >/dev/${CONSOLE} 2>&1"
55
56 diff --git a/defaults/login-remote.sh b/defaults/login-remote.sh
57 index 7f711da..f8c4d08 100644
58 --- a/defaults/login-remote.sh
59 +++ b/defaults/login-remote.sh
60 @@ -66,23 +66,33 @@ then
61 exit 1
62 esac
63 else
64 + gk_ver="$(cat /etc/build_id)"
65 + gk_build_date="$(cat /etc/build_date)"
66 + kernel_ver="$(uname -r)"
67 +
68 export PS1='remote rescueshell \w \# '
69 touch "${GK_SSHD_LOCKFILE}"
70 - good_msg "The lockfile '${GK_SSHD_LOCKFILE}' was created."
71 - good_msg "In order to resume boot process, run 'resume-boot'."
72 - good_msg "Be aware that it will kill your connection which means"
73 - good_msg "you will no longer be able work in this shell."
74 +
75 + GOOD=${BLUE} good_msg "${NORMAL}Welcome to ${BOLD}${gk_ver}${NORMAL} (${gk_build_date}) ${BOLD}remote rescue shell${NORMAL}!"
76 + GOOD=${BLUE} good_msg "${NORMAL}...running Linux kernel ${BOLD}${kernel_ver}${NORMAL}"
77 + echo
78 + good_msg "${NORMAL}The lockfile '${BOLD}${GK_SSHD_LOCKFILE}${NORMAL}' was created."
79 + good_msg "${NORMAL}In order to resume boot process, run '${BOLD}resume-boot${NORMAL}'."
80 + good_msg "${NORMAL}Be aware that it will kill your connection which means"
81 + good_msg "${NORMAL}you will no longer be able to work in this shell."
82
83 if [ -n "${CRYPT_ROOT}" -a ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ]
84 then
85 - good_msg "To remote unlock LUKS-encrypted root device, run 'unlock-luks root'."
86 + good_msg "${NORMAL}To remote unlock LUKS-encrypted root device, run '${BOLD}unlock-luks root${NORMAL}'."
87 fi
88
89 if [ -n "${CRYPT_SWAP}" -a ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ]
90 then
91 - good_msg "To remote unlock LUKS-encrypted swap device, run 'unlock-luks swap'."
92 + good_msg "${NORMAL}To remote unlock LUKS-encrypted swap device, run '${BOLD}unlock-luks swap${NORMAL}'."
93 fi
94
95 + echo
96 +
97 [ -x /bin/sh ] && SH=/bin/sh || SH=/bin/ash
98 exec ${SH} --login
99 fi