From dcd5a31c0db21b7c89fd1d8eca4bb28ae404f8c8 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sun, 12 Jun 2011 05:28:41 +0200 Subject: [PATCH] Revert "Adding live-toram script to copy the running live system to ram and eject the live media." This reverts commit 519ebd66721deac6f6c0ebba3bcb798f5bf6c482. The patch is not used in the upstream project nowadays, so remove it. --- bin/live-toram | 120 --------------------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100755 bin/live-toram diff --git a/bin/live-toram b/bin/live-toram deleted file mode 100755 index b7740a2..0000000 --- a/bin/live-toram +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh - -set -e - -# Read cmdline -for _PARAMETER in $(cat /proc/cmdline) -do - case "${_PARAMETER}" in - module=*) - _MODULE="${_PARAMETER#module=}" - ;; - esac -done - -# Assemble filesystems -if [ -z "${_MODULE}" ] -then - _FILESYSTEMS="/live/image/live/filesystem.squashfs" -else - for _FILESYSTEM in _MODULE - do - _FILESYSTEMS="${_FILESYSTEMS} /live/image/live/${_FILESYSTEM}" - done -fi - -# Exit if system is not debian live -if [ ! -d /live/image ] -then - echo "E: live-toram only works on Debian Live systems." - - exit 1 -fi - -# Exit if filesystem not accessible -for _FILESYSTEM in ${_FILESYSTEMS} -do - if [ ! -r ${_FILESYSTEM} ] - then - echo "E: ${_FILESYSTEM}: No such file" - echo "I: live-toram already run?" - - exit 1 - fi -done - -# Exit if user is unprivileged -if [ "$(id -u)" -ne 0 ] -then - echo "E: need root privileges" - - exit 1 -fi - -# Exit if not enough free memory -_SIZE=0 - -for _FILESYSTEM in ${_FILESYSTEMS} -do - _SIZE="$((${_SIZE} + $(du ${_FILESYSTEM} | awk '{ print $1 }')))" - _MEMORY="$(awk '/MemFree/ { print $2 }' /proc/meminfo)" -done - -case ${@} in - -f|--force) - echo "W: Ignoring memory constrains as requested" - ;; - - *) - if [ $_MEMORY -lt $_SIZE ] - then - echo "E: not enough free memory available." - echo "I: images need ${_SIZE}kB, free memory is ${_MEMORY}kB." - - exit 1 - fi - ;; -esac - -# Copying image to memory -echo "P: Copying images to memory." -echo "P: This may take a while..." - -# FIXME: doesn't work with multiple filesystems -for _FILESYSTEM in ${_FILESYSTEMS} -do - if [ ! -x "$(which rsync 2>/dev/null)" ] - then - rsync -a --progress ${_FILESYSTEM} /tmp/live - else - cp -av ${_FILESYSTEM} /tmp/live - fi - -LANGUAGE=C LANG=C LC_ALL=C perl << EOF -open LOOP, '/dev/null)" ] - then - eject -p -m ${_DEVICE} >/dev/null 2>&1 - fi -fi -- 2.1.4