consolefont: use setfont to save the current font
Using setfont directly to save the font prevents breakage when a distro stores consolefonts in a location other than /usr/share/consolefonts such as Arch which stores them in /usr/share/kbd/consolefonts Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This commit is contained in:
parent
405dfea7ad
commit
746bf5f783
@ -53,14 +53,10 @@ start()
|
||||
done
|
||||
eend $retval
|
||||
|
||||
# Store the last font so we can use it ASAP on boot
|
||||
# Store the font so we can use it ASAP on boot
|
||||
if [ $retval -eq 0 ] && checkpath -W "$RC_LIBEXECDIR"; then
|
||||
mkdir -p "$RC_LIBEXECDIR"/console
|
||||
for font in /usr/share/consolefonts/"$consolefont".*; do
|
||||
:
|
||||
done
|
||||
cp "$font" "$RC_LIBEXECDIR"/console
|
||||
echo "${font##*/}" >"$RC_LIBEXECDIR"/console/font
|
||||
setfont -O "$RC_LIBEXECDIR"/console/font
|
||||
fi
|
||||
|
||||
return $retval
|
||||
|
@ -31,9 +31,8 @@ if service_present "$RC_DEFAULTLEVEL" consolefont ||
|
||||
service_present "$RC_BOOTLEVEL" consolefont; then
|
||||
printf "\033%s" "$termencoding" >"$CONSOLE" 2>/dev/null
|
||||
if [ -r "$RC_LIBEXECDIR"/console/font -a -x /usr/bin/setfont ]; then
|
||||
font="$(cat "$RC_LIBEXECDIR"/console/font)"
|
||||
[ -c "$CONSOLE" ] && cons="-C $CONSOLE"
|
||||
setfont $cons "$RC_LIBEXECDIR"/console/"$font" 2>/dev/null
|
||||
setfont $cons "$RC_LIBEXECDIR"/console/font 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user