blob: 76b149b9fae5e5911ce1a1fb6555b02a5a7a0794 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001[ -e /tmp/.failsafe ] && export FAILSAFE=1
2
3[ -f /etc/banner ] && cat /etc/banner
4[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
5
6grep -Fsq '/ overlay ro,' /proc/mounts && {
7 echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
8 echo 'Please try to remove files from /overlay/upper/... and reboot!'
9}
10
11export PATH="%PATH%"
12export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
13export HOME=${HOME:-/root}
14export PS1='\u@\h:\w\$ '
15export ENV=/etc/shinit
16
17case "$TERM" in
18 xterm*|rxvt*)
19 export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
20 ;;
21esac
22
23[ -n "$FAILSAFE" ] || {
24 for FILE in /etc/profile.d/*.sh; do
25 [ -e "$FILE" ] && . "$FILE"
26 done
27 unset FILE
28}
29
30if ( grep -qs '^root::' /etc/shadow && \
31 [ -z "$FAILSAFE" ] )
32then
33cat << EOF
34=== WARNING! =====================================
35There is no root password defined on this device!
36Use the "passwd" command to set up a new password
37in order to prevent unauthorized SSH logins.
38--------------------------------------------------
39EOF
40fi