Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 90zfsbootmenu/zfs-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if mountpoint="$( allow_rw=yes mount_zfs "${selected}" )"; then
echo -e "$( colorize orange "${selected}") is mounted ${writemode}, /tmp is shared and read/write\n"

# regardless of shell, set PS1
if ! env "PS1=$( colorize orange "${selected}") > " chroot "${mountpoint}" "${_SHELL}" "${chroot_extra}" ; then
if ! env "PS1=$( colorize orange "${selected}") \w > " chroot "${mountpoint}" "${_SHELL}" "${chroot_extra}" ; then
zdebug "chroot ${selected}:${_SHELL} returned code $?"
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion 90zfsbootmenu/zfsbootmenu-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,7 @@ emergency_shell() {

echo -n "Launching emergency shell: "
echo -e "${message}\n"
env "PS1=$( colorize orange "zfsbootmenu") > " /bin/bash --rcfile <( test -f /lib/zfsbootmenu-lib.sh && echo "source /lib/zfsbootmenu-lib.sh" )
env "PS1=$( colorize orange "zfsbootmenu") \w > " /bin/bash --rcfile <( test -f /lib/zfsbootmenu-lib.sh && echo "source /lib/zfsbootmenu-lib.sh" )
}

# prints: nothing
Expand Down
20 changes: 11 additions & 9 deletions 90zfsbootmenu/zfsbootmenu-preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@ BOOTFS="${2}"
IFS=' ' read -r _fs selected_kernel _initramfs <<<"$( select_kernel "${ENV}")"
selected_kernel="${selected_kernel##*/}"

if [ "${BOOTFS}" = "${ENV}" ]; then
_EXTRAS+=( "default," )
fi

if be_has_encroot "${ENV}" >/dev/null; then
_EXTRAS+=( "encrypted," )
fi

pool="${ENV%%/*}"
if is_writable "${pool}" ; then
_readonly="r/w"
_EXTRAS+=( "r/w" )
_COLOR="red"
else
_readonly="r/o"
_EXTRAS+=( "r/o" )
_COLOR="green"
fi

if [ "${BOOTFS}" = "${ENV}" ]; then
_DEFAULT="default, "
else
_DEFAULT=""
fi

selected_arguments="$( load_be_cmdline "${ENV}" )"
selected_arguments="$( center_string "$( load_be_cmdline "${ENV}" )" )"

selected_env_str="$( center_string "${ENV} (${_DEFAULT}${_readonly}) - ${selected_kernel}" )"
selected_env_str="$( center_string "${ENV} (${_EXTRAS[*]}) - ${selected_kernel}" )"

# colorize doesn't automatically add a newline
if [ -f "${BASE}/have_errors" ]; then
Expand Down