Re: [PATCH] Generate /etc/initramfs-tools/conf.d/resume during install
Cody A.W. Somerville wrote:
> I've created a live-installer hook to generate the resume file
nice, thanks ;)
>diff -Nur a/live-installer.d/initramfs-tools b/live-installer.d/initramfs-tools
--- a/live-installer.d/initramfs-tools 1969-12-31 20:00:00.000000000 -0400
+++ b/live-installer.d/initramfs-tools 2009-07-28 16:33:11.000000000 -0300
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+
+# Detect resume partition and write it to configuration file.
+
+. /usr/lib/base-installer/library.sh
+
+resumeconf=$IT_CONFDIR/resume
+
+resume_devfs="$(get_resume_partition)" || resume_devfs=
+if [ "$resume_devfs" ] && [ -e "$resume_devfs" ]; then
simplify: if $resume_defs exists, it's also never empty.
+ sed -e "s@^#* *RESUME=.*@RESUME=$resume@" < $resumeconf >
$resumeconf.new &&
+ mv $resumeconf.new $resumeconf
simplify: busybox's sed understands -i
otherwise looks good from the first look, will have a look and generate
a test image later.
--
Address: Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email: daniel.baumann@panthera-systems.net
Internet: http://people.panthera-systems.net/~daniel-baumann/
Reply to: