linuxrc: move resume initialization code to resume_init()

master
Fabio Erculiani 12 years ago
parent 3f14137bc0
commit af1f319509

@ -1394,6 +1394,45 @@ rundebugshell() {
fi fi
} }
resume_init() {
if [ -z "${REAL_RESUME}" ]; then
return 0
fi
if [ "${NORESUME}" = "1" ]; then
return 0
fi
case "${REAL_RESUME}" in
LABEL=*|UUID=*)
RESUME_DEV=""
retval=1
if [ ${retval} -ne 0 ]; then
RESUME_DEV=$(findfs "${REAL_RESUME}" 2>/dev/null)
retval=$?
fi
if [ ${retval} -ne 0 ]; then
RESUME_DEV=$(busybox findfs "${REAL_RESUME}" 2>/dev/null)
retval=$?
fi
if [ ${retval} -ne 0 ]; then
RESUME_DEV=$(blkid -o device -l -t "${REAL_RESUME}")
retval=$?
fi
if [ ${retval} -eq 0 ] && [ -n "${RESUME_DEV}" ]; then
good_msg "Detected real_resume=${RESUME_DEV}"
REAL_RESUME="${RESUME_DEV}"
fi
;;
esac
do_resume
}
do_resume() { do_resume() {
if [ -d /proc/suspend2 -o -d /sys/power/suspend2 -o -d /sys/power/tuxonice ]; then if [ -d /proc/suspend2 -o -d /sys/power/suspend2 -o -d /sys/power/tuxonice ]; then
tuxonice_resume tuxonice_resume

@ -283,41 +283,8 @@ setup_keymap
# Initialize LUKS root device except for livecd's # Initialize LUKS root device except for livecd's
is_livecd || start_luks is_livecd || start_luks
if ! is_livecd # Initialize resume from hibernation
then is_livecd || resume_init
if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ]
then
case "${REAL_RESUME}" in
LABEL=*|UUID=*)
RESUME_DEV=""
retval=1
if [ ${retval} -ne 0 ]; then
RESUME_DEV=$(findfs "${REAL_RESUME}" 2>/dev/null)
retval=$?
fi
if [ ${retval} -ne 0 ]; then
RESUME_DEV=$(busybox findfs "${REAL_RESUME}" 2>/dev/null)
retval=$?
fi
if [ ${retval} -ne 0 ]; then
RESUME_DEV=$(blkid -o device -l -t "${REAL_RESUME}")
retval=$?
fi
if [ ${retval} -eq 0 ] && [ -n "${RESUME_DEV}" ]; then
good_msg "Detected real_resume=${RESUME_DEV}"
REAL_RESUME="${RESUME_DEV}"
fi
;;
esac
do_resume
fi
fi
mkdir -p "${NEW_ROOT}" mkdir -p "${NEW_ROOT}"
CHROOT="${NEW_ROOT}" CHROOT="${NEW_ROOT}"

Loading…
Cancel
Save