[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#335801: initramfs-tools: uses non-existant stat (patch attached)



Package: initramfs-tools
Version: 0.32

scripts/functions (load_modules) scripts/local-premount/suspend both
use "stat" which isn't provided by busybox (1.01-3) or klibc (1.1.1-2).

Alternatively the use of stat could be replaced by awk (patches
attached).

Unfortunately if you have /sys/power/resume then this buglet means
that the initramfs writes "0x:0x" to /sys/power/resume which hangs the
boot :-(

Thanks,

Adrian
-- 
Email: adrian@smop.co.uk  -*-  GPG key available on public key servers
Debian GNU/Linux - the maintainable distribution   -*-  www.debian.org
Avoid working with children, animals and Microsoft "operating" systems
--- suspend.orig	2005-10-25 22:25:30.000000000 +0100
+++ suspend	2005-10-25 22:24:03.000000000 +0100
@@ -24,7 +24,7 @@
 fi
 
 if [ -e /sys/power/resume ]; then
-	major=$((0x$(stat -c%t ${resume})))
-	minor=$((0x$(stat -c%T ${resume})))
-	echo ${major}:${minor} >/sys/power/resume
+	major_minor=$(ls -l ${resume} | \
+	  awk '{printf "0x%x:0x%x", $5, $6}')
+	echo $major_minor >/sys/power/resume
 fi
--- functions.orig	2005-10-25 21:11:18.000000000 +0100
+++ functions	2005-10-25 22:22:36.000000000 +0100
@@ -227,9 +227,9 @@
 
 	if [ -e /sys/power/resume ]; then
 		if [ -e "${resume}" ]; then
-			major=$((0x$(stat -c%t ${resume})))
-			minor=$((0x$(stat -c%T ${resume})))
-			echo ${major}:${minor} >/sys/power/resume
+			major_minor=$(ls -l ${resume} | \
+			  awk '{printf "0x%x:0x%x", $5, $6}')
+			echo $major_minor >/sys/power/resume
 		fi
 	fi
 

Reply to: