if ! grep ${KOREADER_DIR}/fonts/host /proc/mounts >/dev/null 2>&1;then
if ! grep ${KOREADER_DIR}/fonts/host /proc/mounts >/dev/null 2>&1;then
logmsg "Mounting system fonts . . ."
mount -o bind /usr/java/lib/fonts ${KOREADER_DIR}/fonts/host
fi
# bind-mount altfonts
if[ -d /mnt/us/fonts ];then
if[ -d /mnt/us/fonts ];then
mkdir -p ${KOREADER_DIR}/fonts/altfonts
if ! grep ${KOREADER_DIR}/fonts/altfonts /proc/mounts >/dev/null 2>&1;then
if ! grep ${KOREADER_DIR}/fonts/altfonts /proc/mounts >/dev/null 2>&1;then
logmsg "Mounting altfonts . . ."
mount -o bind /mnt/us/fonts ${KOREADER_DIR}/fonts/altfonts
fi
fi
# bind-mount csp fonts
if[ -d /var/local/font/mnt ];then
if[ -d /var/local/font/mnt ];then
mkdir -p ${KOREADER_DIR}/fonts/cspfonts
if ! grep ${KOREADER_DIR}/fonts/cspfonts /proc/mounts >/dev/null 2>&1;then
if ! grep ${KOREADER_DIR}/fonts/cspfonts /proc/mounts >/dev/null 2>&1;then
logmsg "Mounting cspfonts . . ."
mount -o bind /var/local/font/mnt ${KOREADER_DIR}/fonts/cspfonts
fi
fi
# bind-mount linkfonts
if[ -d /mnt/us/linkfonts/fonts ];then
if[ -d /mnt/us/linkfonts/fonts ];then
mkdir -p ${KOREADER_DIR}/fonts/linkfonts
if ! grep ${KOREADER_DIR}/fonts/linkfonts /proc/mounts >/dev/null 2>&1;then
if ! grep ${KOREADER_DIR}/fonts/linkfonts /proc/mounts >/dev/null 2>&1;then
logmsg "Mounting linkfonts . . ."
mount -o bind /mnt/us/linkfonts/fonts ${KOREADER_DIR}/fonts/linkfonts
fi
@ -173,17 +172,17 @@ fi
# check if we need to disable the system passcode, because it messes with us in fun and interesting (and, more to the point, intractable) ways...
# NOTE: The most egregious one being that it inhibits the outOfScreenSaver event on wakeup until the passcode is validated, which we can't do, since we capture all input...
# NOTE: Dump the fb so we can restore something useful on exit...
cat /dev/fb0 > /var/tmp/koreader-fb.dump
cat /dev/fb0 >/var/tmp/koreader-fb.dump
# NOTE: We want to disable the status bar (at the very least). Unfortunately, the soft hide/unhide method doesn't work properly anymore since FW 5.6.5...
# NOTE: And, oh, joy, on FW >= 5.7.2, this is not enough to prevent the clock from refreshing, so, take the bull by the horns, and SIGSTOP the WM while we run...
# through fmon, or from another launcher (KSM or advboot)
# Do not delete this line because KSM detects newer versions of KOReader by the presence of the phrase 'from_nickel'.
exportFROM_NICKEL="false"
if pkill -0 nickel;then
if pkill -0 nickel;then
FROM_NICKEL="true"
fi
if["${FROM_NICKEL}"="true"];then
if["${FROM_NICKEL}"="true"];then
# Detect if we were started from KFMon
FROM_KFMON="false"
if pkill -0 kfmon ;then
if pkill -0 kfmon;then
# That's a start, now check if KFMon truly is our parent...
if["$(pidof kfmon)" -eq "${PPID}"];then
if["$(pidof kfmon)" -eq "${PPID}"];then
FROM_KFMON="true"
fi
fi
if["${FROM_KFMON}"="true"];then
if["${FROM_KFMON}"="true"];then
# Siphon nickel's full environment, since KFMon inherits such a minimal one, and that apparently confuses the hell out of Nickel for some reason if we decide to restart it without a reboot...
for env in $(xargs -n 1 -0 <"/proc/$(pidof nickel)/environ");do
for env in $(xargs -n 1 -0 <"/proc/$(pidof nickel)/environ");do
# start fmon again. Note that we don't have to worry about reaping this, nickel kills on-animator.sh on start.
( usleep 400000; /etc/init.d/on-animator.sh )&
(
usleep 400000
/etc/init.d/on-animator.sh
)&
# environment needed by nickel, from /etc/init.d/rcS:
if[ ! -n "${WIFI_MODULE_PATH}"];then
if[ ! -n "${WIFI_MODULE_PATH}"];then
INTERFACE="wlan0"
WIFI_MODULE="ar6000"
if["${PLATFORM}" !="freescale"];then
if["${PLATFORM}" !="freescale"];then
INTERFACE="eth0"
WIFI_MODULE="dhd"
fi
@ -28,7 +31,7 @@ export LANG="en_US.UTF-8"
# Make sure we kill the WiFi first, because nickel apparently doesn't like it if it's up... (cf. #1520)
# NOTE: That check is possibly wrong on PLATFORM == freescale (because I don't know if the sdio_wifi_pwr module exists there), but we don't terribly care about that.