From d4168a89b1a1c8cc1a9a179e70136089230a5657 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Dec 2007 16:07:55 +0000 Subject: [PATCH] * Get rid of some spurious error messages. svn path=/nixos/trunk/; revision=9968 --- boot/boot-stage-1-init.sh | 7 +++++-- boot/boot-stage-2-init.sh | 5 ++++- installer/grub-menu-builder.sh | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/boot/boot-stage-1-init.sh b/boot/boot-stage-1-init.sh index b7b558971a6..e4975981413 100644 --- a/boot/boot-stage-1-init.sh +++ b/boot/boot-stage-1-init.sh @@ -63,9 +63,12 @@ for i in @modules@; do modprobe $i done + # Try to resume - all modules are loaded now -echo 0 > /sys/power/tuxonice/user_interface/enabled -echo 1 > /sys/power/tuxonice/do_resume || echo Failed to resume..; +if test -n "$(cat /sys/power/tuxonice/resume)"; then + echo 0 > /sys/power/tuxonice/user_interface/enabled + echo 1 > /sys/power/tuxonice/do_resume || echo "Failed to resume..." +fi # Create device nodes in /dev. diff --git a/boot/boot-stage-2-init.sh b/boot/boot-stage-2-init.sh index a76873fc52c..f6b74543d8f 100644 --- a/boot/boot-stage-2-init.sh +++ b/boot/boot-stage-2-init.sh @@ -114,7 +114,10 @@ export MODULE_DIR=@kernel@/lib/modules/ # Run any user-specified commands. @shell@ @bootLocal@ -mkswap $(cat /sys/power/tuxonice/resume) || echo 'Failed to clear saved image.' +resumeDevice="$(cat /sys/power/tuxonice/resume)" +if test -n "$resumeDevice"; then + mkswap "$resumeDevice" || echo 'Failed to clear saved image.' +fi # Start Upstart's init. We start it through the # /var/run/current-system symlink indirection so that we can upgrade diff --git a/installer/grub-menu-builder.sh b/installer/grub-menu-builder.sh index 9c76fbb6f6f..ddcec0e93d5 100644 --- a/installer/grub-menu-builder.sh +++ b/installer/grub-menu-builder.sh @@ -1,5 +1,7 @@ #! @bash@/bin/sh -e +shopt -s nullglob + export PATH=/empty for i in @path@; do PATH=$PATH:$i/bin; done @@ -88,9 +90,7 @@ EOF # Add all generations of the system profile to the menu, in reverse # (most recent to least recent) order. -for link in $( - (ls -d $default/fine-tune/* ) \ - | sort -n); do +for link in $((ls -d $default/fine-tune/* ) | sort -n); do date=$(stat --printf="%y\n" $link | sed 's/\..*//') addEntry "NixOS - variation" $link "" done