pax_global_header00006660000000000000000000000064117525661310014521gustar00rootroot0000000000000052 comment=7437409ec08a8eec13ddce8304125c806e19a732 make-initrd-propagator-resume-0.2/000075500000000000000000000000001175256613100172365ustar00rootroot00000000000000make-initrd-propagator-resume-0.2/.gear-rules000064400000000000000000000000071175256613100213020ustar00rootroot00000000000000tar: . make-initrd-propagator-resume-0.2/make-initrd-propagator-resume.spec000064400000000000000000000022571175256613100257760ustar00rootroot00000000000000%add_findreq_skiplist /usr/share/make-initrd/features/* Name: make-initrd-propagator-resume Version: 0.2 Release: alt1 Summary: Put propagator resume from disk hooks into make-initrd generated image License: GPL Group: System/Base Source0: %name-%version.tar # For new put-file utility Requires: make-initrd >= 0.7.6-alt1 BuildArch: noarch %description Make-initrd feature, able to add resume from disk support to hybrid propagator/make-initrd initrd %prep %setup %install mkdir -p %buildroot/usr/share/make-initrd/features/ cp -a propagator-resume %buildroot/usr/share/make-initrd/features/ %files %_datadir/make-initrd/features/propagator-resume %changelog * Thu May 10 2012 Michael Shigorin 0.2-alt1 - NMU: updated for current make-initrd (see make-initrd-propagator) * Wed Apr 27 2011 Mykola Grechukh 0.1-alt1 - resume from disk works - blacklisting modules * Tue Apr 19 2011 Mykola Grechukh 0.0-alt3 - debugging * Tue Apr 19 2011 Mykola Grechukh 0.0-alt2 - half-implemented, taken code from initramfs * Sat Apr 16 2011 Mykola Grechukh 0.0-alt1 - initial work. No real functionality yet make-initrd-propagator-resume-0.2/propagator-resume/000075500000000000000000000000001175256613100227125ustar00rootroot00000000000000make-initrd-propagator-resume-0.2/propagator-resume/config.mk000064400000000000000000000001471175256613100245120ustar00rootroot00000000000000PROPAGATOR_RESUME_DATADIR = $(FEATURESDIR)/propagator-resume/data PROPAGATOR_RESUME_FILES = /bin/sed make-initrd-propagator-resume-0.2/propagator-resume/data/000075500000000000000000000000001175256613100236235ustar00rootroot00000000000000make-initrd-propagator-resume-0.2/propagator-resume/data/sbin/000075500000000000000000000000001175256613100245565ustar00rootroot00000000000000make-initrd-propagator-resume-0.2/propagator-resume/data/sbin/init-premount000075500000000000000000000016601175256613100273210ustar00rootroot00000000000000#!/bin/sh wait_for_device () { if [ ! -e "$1" ]; then echo "$2" # Default delay is 180s slumber=3 slumber=$(( ${slumber} * 10 )) while [ ${slumber} -gt 0 ] && [ ! -e "$1" ]; do /bin/sleep 0.1 slumber=$(( ${slumber} - 1 )) done fi } try_to_resume () { resume=`/bin/cat /tmp/resume` [ -n "$resume" ] || return 0 echo resuming from "$resume" if [ ! -e "${resume}" ]; then wait_for_device "$resume" "Waiting for resume device" fi if [ -e "$resume" ]; then # hardcode path, uswsusp ships an resume binary too echo going to /bin/resume "$resume" /bin/resume "$resume" else echo "Resume device $resume not found - doing normal boot" fi } try_to_resume2 () { [ -n "$resume2" ] || return 0 [ -e /sys/power/suspend2/do_resume ] || { echo "Kernel does not support resume" return 0 } echo > /sys/power/suspend2/do_resume } try_to_resume try_to_resume2 echo ok - finished premount with resume $resume make-initrd-propagator-resume-0.2/propagator-resume/data/sbin/init-top000075500000000000000000000015561175256613100262560ustar00rootroot00000000000000#!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH [ -d /tmp ] || mkdir /tmp for x in $(cat /proc/cmdline); do case $x in blacklist=*) for m in $(echo ${x#blacklist=} | /bin/sed 's/,/ /g') do echo -e "# added by propagator-hooks/init-top\nblacklist $m\n" >> \ /etc/modprobe.d/blacklist done ;; resume=*) RESUME="${x#resume=}" ;; noresume) NORESUME=y ;; resume2=*) RESUME2="${x#resume2=}" ;; noresume2) NORESUME2=y ;; *) ;; esac done if [ -z "${NORESUME}" ]; then resume=${RESUME} fi if [ -z "${NORESUME2}" ]; then resume2=${RESUME2} fi case "$resume" in LABEL=*) echo "ENV{ID_FS_USAGE}==\"filesystem|other\", ENV{ID_FS_LABEL}==\"${resume#LABEL=}\", SYMLINK+=\"resume\"" > /etc/udev/rules.d/99-resume.rules resume="/dev/resume" ;; UUID=*) resume="/dev/disk/by-uuid/${resume#UUID=}" ;; esac echo "$resume" > /tmp/resume make-initrd-propagator-resume-0.2/propagator-resume/rules.mk000064400000000000000000000003121175256613100243710ustar00rootroot00000000000000propagator-resume: @echo "Adding support for resume from hibernate to propagator ..." @put-file "$(ROOTDIR)" $(PROPAGATOR_FILES) @put-tree "$(ROOTDIR)" $(PROPAGATOR_DATADIR) pack: propagator-resume