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
3 changes: 2 additions & 1 deletion 90zfsbootmenu/zfs-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if mountpoint="$( allow_rw=yes mount_zfs "${selected}" )"; then
if [ -x "${mountpoint}/bin/bash" ] \
&& chroot "${mountpoint}" /bin/bash -c "exit 0" >/dev/null 2>&1 ; then
_SHELL="/bin/bash"
chroot_extra="--norc"
elif [ -x "${mountpoint}/bin/sh" ] \
&& chroot "${mountpoint}" /bin/sh -c "exit 0" >/dev/null 2>&1 ; then
_SHELL="/bin/sh"
Expand All @@ -42,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}" ; then
if ! env "PS1=$( colorize orange "${selected}") > " 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"
/bin/bash --rcfile <( test -f /lib/zfsbootmenu-lib.sh && echo "source /lib/zfsbootmenu-lib.sh" )
env "PS1=$( colorize orange "zfsbootmenu") > " /bin/bash --rcfile <( test -f /lib/zfsbootmenu-lib.sh && echo "source /lib/zfsbootmenu-lib.sh" )
}

# prints: nothing
Expand Down