grml-rescueboot-0.4.4/0000755000000000000000000000000012217773325011527 5ustar grml-rescueboot-0.4.4/TODO0000644000000000000000000000024111511563722012206 0ustar * standarized support for custom options (so it works e.g. with Ubuntu as well) * set bootentry title within GRUB based on ISO (so e.g. "Grml" becomes "Ubuntu") grml-rescueboot-0.4.4/etc/0000755000000000000000000000000011502171530012264 5ustar grml-rescueboot-0.4.4/etc/default/0000755000000000000000000000000011511563564013724 5ustar grml-rescueboot-0.4.4/etc/default/grml-rescueboot0000644000000000000000000000041711511563563016761 0ustar ## Configuration file for Debian package grml-rescueboot. # Location of ISOs: # ISO_LOCATION="/boot/grml/" # To set any specific bootoptions for rescue images # present in /boot/grml just set and enable the following option: # CUSTOM_BOOTOPTIONS="ssh=password lang=de" grml-rescueboot-0.4.4/42_grml0000755000000000000000000000571612217773325012734 0ustar #!/bin/sh # Filename: 42_grml # Purpose: grub-mkconfig helper script for Grml rescue systems # Authors: Grml team (grml.org), (c) Andreas Gredler , Michael Prokop # License: This file is licensed under the GPL v2+. ################################################################################ set -e prefix=/usr exec_prefix=${prefix} bindir=${exec_prefix}/bin libdir=${exec_prefix}/lib . ${libdir}/grub/grub-mkconfig_lib # default unless configured otherwise: ISO_LOCATION="/boot/grml" if [ -r /etc/default/grml-rescueboot ] ; then . /etc/default/grml-rescueboot fi resolve_dm_name() { retval="$1" base=${1##*/} for block in /sys/block /sys/class/block ; do [ ! -d ${block}/${base}/dm ] && continue retval="/dev/mapper/$(cat ${block}/${base}/dm/name)" break done case "$retval" in /dev/dm-*) minor=${retval##*-} retval="/dev/mapper/$(dmsetup info -C --noheadings -o name -j 253 -m $minor)" ;; esac echo "$retval" } get_dependencies() { device=${1} if [ -z ${device} ] ; then return fi device=$(readlink -f ${device}) case "$device" in /dev/mapper/*) device="/dev/dm-$(dmsetup info -C --noheadings -o minor "$device")" ;; esac base=${device##*/} dependencies="" additional_dependencies="" for block in /sys/block /sys/class/block ; do [ ! -d ${block}/${base}/slaves ] && continue for file in ${block}/${base}/slaves/* ; do dep_name="/dev/${file##*/}" dep_name=$(resolve_dm_name ${dep_name}) # resolve recursively all dependencies additional_dependencies=$(get_dependencies ${dep_name}) dependencies="$dependencies $additional_dependencies $dep_name" done break done echo $dependencies } iso_list="" for file in "${ISO_LOCATION}"/*.iso ; do if grub_file_is_not_garbage "$file" ; then iso_list="$iso_list $file " fi done for grmliso in $iso_list ; do rel_dirname="$(make_system_path_relative_to_its_root $(dirname $grmliso))" grml="$(basename $grmliso)" device="$(${grub_probe} -t device ${grmliso})" additional_param="" case "$device" in /dev/mapper*|/dev/md*) dependencies=$(get_dependencies ${device}) dep_string="" for dep in $dependencies $device ; do dep_string="$dep_string,$dep" done dep_string=${dep_string#,} additional_param="live-media=$dep_string" ;; esac echo "Found Grml ISO image: $grmliso" >&2 title="Grml Rescue System ($grml)" grub_prep=$(prepare_grub_to_access_device "$device" | sed -e "s/^/ /") cat << EOF menuentry "${title}" { ${grub_prep} iso_path="${rel_dirname}/${grml}" export iso_path kernelopts=" $CUSTOM_BOOTOPTIONS $additional_param " export kernelopts loopback loop "${rel_dirname}/$grml" set root=(loop) configfile /boot/grub/loopback.cfg } EOF done ## END OF FILE ################################################################# grml-rescueboot-0.4.4/debian/0000755000000000000000000000000012217773401012744 5ustar grml-rescueboot-0.4.4/debian/dirs0000644000000000000000000000001311502165312013612 0ustar /boot/grml grml-rescueboot-0.4.4/debian/grml-rescueboot.lintian-overrides0000644000000000000000000000016211674152326021437 0ustar # Shipping /boot/grml (empty) is intentional. grml-rescueboot binary: package-contains-empty-directory boot/grml/ grml-rescueboot-0.4.4/debian/postinst0000644000000000000000000000234311720447614014556 0ustar #!/bin/sh # postinst script for grml-rescueboot set -e update_grub_wrapper() { # default, unless configured otherwise: ISO_LOCATION=/boot/grml if [ -r /etc/default/grml-rescueboot ] ; then . /etc/default/grml-rescueboot fi if ! ls "${ISO_LOCATION}"/*iso >/dev/null 2>&1 ; then echo "INFO: No *.iso files found inside ${ISO_LOCATION}." echo "INFO: Please create ${ISO_LOCATION} and place rescue ISO(s) there." echo "INFO: Finally invoke update-grub and enjoy your rescue system." return 0 fi if ! which update-grub >/dev/null 2>&1; then echo "WARN: ISOs found inside ${ISO_LOCATION} but update-grub not present (huh?)" return 0 fi if ! [ -e /boot/grub/grub.cfg ] ; then echo "WARN: ISOs found inside ${ISO_LOCATION} but /boot/grub/grub.cfg does not exist." echo "WARN: Ignoring request to run update-grub to avoid possible boot loader problems." return 0 fi echo "INFO: ISOs found inside ${ISO_LOCATION}, invoking update-grub:" update-grub } case "$1" in configure) update_grub_wrapper ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 grml-rescueboot-0.4.4/debian/copyright0000644000000000000000000000244311703567775014720 0ustar This work was packaged for Debian by: Andreas "Jimmy" Gredler on Sat, 06 Nov 2010 12:28:45 +0100 It was downloaded from: http://grml.org/ Copyright: Copyright (C) 2010 Andreas "Jimmy" Gredler Copyright (C) 2010, 2011, 2012 Michael Prokop License: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. The Debian packaging is: Copyright (C) 2010 Andreas "Jimmy" Gredler Copyright (C) 2011, 2012 Michael Prokop and is licensed under the GPL version 2 or (at your option) any later version, see above. grml-rescueboot-0.4.4/debian/install0000644000000000000000000000012211703567775014346 0ustar 42_grml etc/grub.d/ etc/default etc/ debian/README usr/share/doc/grml-rescueboot/ grml-rescueboot-0.4.4/debian/postrm0000644000000000000000000000073011720447750014216 0ustar #!/bin/sh # postrm script for grml-rescueboot set -e case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) if test -e /boot/grub/grub.cfg && which update-grub >/dev/null 2>&1; then echo "Updating grub.cfg to make sure there are no non-existing entries being left." update-grub fi ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 grml-rescueboot-0.4.4/debian/README0000644000000000000000000000241211703567775013641 0ustar The Debian Package grml-rescueboot ================================== Usually systems are rescued with CD or USB stick. grml-rescueboot makes it possible to simply copy an Grml ISO image to the harddisk and boot the rescue image. This eliminates the need to carry around a USB stick to rescue a system as long as the hard disk and the boot manager still work. grml-rescueboot includes the script 42_grml which is installed in /etc/grub.d and run when update-grub is executed. The script looks for ISO images in /boot/grml/ and adds an entry for each image found. Howto ----- - Get a recent Grml image from http://grml.org/download/ - Copy the image to /boot/grml - Run update-grub - Reboot and enjoy your new rescue system Limitations ----------- grml-rescueboot uses the loopback feature of GRUB2, so it won't work with legacy GRUB. Furthermore the ISO image needs to support loopback.cfg, a file which is placed in /boot/grub/. Grml supports loopback.cfg beginning with release version 2010.04. More technical details can be found here: http://www.supergrubdisk.org/wiki/Loopback.cfg Create your own ISO ------------------- You can make your own Grml Live ISO image using the grml-live build framework. Visit http://grml.org/grml-live/ and http://grml.org/ for more information. grml-rescueboot-0.4.4/debian/compat0000644000000000000000000000000211502165312014132 0ustar 7 grml-rescueboot-0.4.4/debian/changelog0000644000000000000000000000740112217773400014617 0ustar grml-rescueboot (0.4.4) unstable; urgency=low [ Michael Lass ] * [700e01c] Fix leaked file descriptors -- Michael Prokop Mon, 23 Sep 2013 10:08:04 +0200 grml-rescueboot (0.4.3) unstable; urgency=low [ Christian Hofstaedtler ] * [12bae4d] Remove obsolete DM-Upload-Allowed flag * [d63ca69] Bump Standards-Version to 3.9.4 (no changes needed) * [3205bd3] Allow use with grub-efi-amd64 (Closes: #680717) -- Michael Prokop Tue, 21 May 2013 22:33:25 +0200 grml-rescueboot (0.4.2) unstable; urgency=low * [395abc5] Maintainer scripts: test for presence of grub.cfg, don't execute update-grub otherwise (Closes: #660588) -- Michael Prokop Mon, 20 Feb 2012 14:58:33 +0100 grml-rescueboot (0.4.1) unstable; urgency=low [ Christian Hofstaedtler ] * [999a45a] uppercase acronyms in package description (Closes: #637846) * [19ae090] Switch to source format 3.0 (native) * [db232cc] Override lintian I: package-contains-empty-directory [ Michael Prokop ] * [2b880e9] Improve package description to clarify usage scenarios (Closes: #652816) * [645c408] Install and improve README to provide usage instructions (Closes: #653695) -- Michael Prokop Thu, 12 Jan 2012 15:40:07 +0100 grml-rescueboot (0.4.0) unstable; urgency=low The "initial upload to Debian" release. [ Michael Prokop ] * [241540a] Bump Standards-Version to 3.9.2. * [d73ed97] Adjust Maintainers and Uploaders field, add DM-Upload- Allowed and remove Origin/Bugs fields for inclusion in Debian. * [1415f0a] Adjust header information in 42_grml for inclusion in Debian. * [886df31] Adjust README file WRT usage scenario of grml-rescueboot. * [ccfa8e7] Control file: switch Section from misc to admin. * [a499f1a] Update copyright information. [ Ulrich Dangel ] * [0b03180] Determine dependency for target device. [ Christian Hofstaedtler ] * [c55fca9] Update debian/control headers Homepage, Vcs-*, Origin, Bugs. -- Michael Prokop Fri, 29 Jul 2011 12:34:13 +0200 grml-rescueboot (0.3.3) unstable; urgency=low [ Ulrich Dangel ] * [b2a6895] Add support for raid devices [ Christian Hofstaedtler ] * [0858c92] Work around grub sillyness of adding " to cmdline -- Christian Hofstaedtler Sat, 26 Mar 2011 00:42:23 +0100 grml-rescueboot (0.3.2) unstable; urgency=low [ Ulrich Dangel ] * [e5a68ae] Refactored 42_grml and support lvm devices [Closes: issue971]. -- Christian Hofstaedtler Fri, 25 Mar 2011 22:52:36 +0100 grml-rescueboot (0.3.1) unstable; urgency=low * [6323d69] Probe the device where the Grml ISO is being stored using ${grub_probe} instead of using ${GRUB_DEVICE_BOOT}. [Closes: issue977] - thanks to Johann Felix Soden for the bugreport and the patch. -- Michael Prokop Mon, 21 Mar 2011 00:25:57 +0100 grml-rescueboot (0.3.0) unstable; urgency=low * [3c6f08e] Use prepare_grub_to_access_device to provide further menu entry details for GRUB. - thanks to Frédéric Boiteux for the bugreport. * [81d5556] Implement CUSTOM_BOOTOPTIONS handling via kernelopts. -- Michael Prokop Mon, 21 Feb 2011 22:23:25 +0100 grml-rescueboot (0.2.0) unstable; urgency=low * [199476a] post-maintainer scripts: make sure update-grub is present before executing it - thanks to Samat K Jain for reporting. * [d583c5d] Add TODO file. * [1e7153d] Support setting location of ISOs via ISO_LOCATION in /etc/default/grml-rescueboot. -- Michael Prokop Fri, 07 Jan 2011 11:30:24 +0100 grml-rescueboot (0.1.0) unstable; urgency=low [ Andreas "Jimmy" Gredler ] * Initial Release. -- Michael Prokop Wed, 15 Dec 2010 18:20:53 +0100 grml-rescueboot-0.4.4/debian/control0000644000000000000000000000157012146754700014354 0ustar Source: grml-rescueboot Section: admin Priority: extra Maintainer: Grml Team Uploaders: Michael Prokop , Alexander Wirt , Christian Hofstaedtler , Ulrich Dangel Build-Depends: debhelper (>= 7) Standards-Version: 3.9.4 Homepage: http://git.grml.org/?p=grml-rescueboot.git Vcs-git: git://git.grml.org/grml-rescueboot.git Vcs-Browser: http://git.grml.org/?p=grml-rescueboot.git Package: grml-rescueboot Architecture: all Depends: grub-pc | grub-efi-amd64, ${shlibs:Depends}, ${misc:Depends} Description: Integrates Grml ISO booting into GRUB This package provides a script for update-grub which looks for Grml ISO images in /boot/grml and automatically adds an entry for each image. The purpose is to use one of those images to boot a Grml rescue system without using a CD or USB stick. grml-rescueboot-0.4.4/debian/rules0000755000000000000000000000067211502165312014021 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ grml-rescueboot-0.4.4/debian/source/0000755000000000000000000000000011674152326014247 5ustar grml-rescueboot-0.4.4/debian/source/format0000644000000000000000000000001511674152326015456 0ustar 3.0 (native)