Bug 2861 - work with empty /proc
Summary: work with empty /proc
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: hasher (show other bugs)
Version: unstable
Hardware: all Linux
: P5 enhancement
Assignee: Dmitry V. Levin
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-20 12:12 MSD by imz
Modified: 2003-08-25 15:18 MSD (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description imz 2003-08-20 12:12:40 MSD
/usr/share/hasher/initroot terminates too early when /proc is empty. This patch makes it work:

--- initroot.orig       2003-07-30 18:24:24 +0400
+++ initroot    2003-08-20 12:08:44 +0400
@@ -107,7 +107,7 @@
 gid2=\"$(echo \"$ugid2\" |cut -d: -f2)\"
 
 [ -n \"$nprocs\" ] ||
-       nprocs=\"$(N=`egrep -cs ^cpu[0-9]+ /proc/stat`; [ \"$N\" -gt 0 ] 2>/dev/null && echo -n \"$N\" || echo 1)\"
+       nprocs=\"$(N=`egrep -cs ^cpu[0-9]+ /proc/stat ||:`; [ \"$N\" -gt 0 ] 2>/dev/null && echo -n \"$N\" || echo 1)\"
 
 filelist=\"$(print_uris setup filesystem rpm \'fakeroot>=0:0.7.3\')\" ||
        Fatal \"failed to generate initial package file list.\"

---

---
hasher-0.4-alt1
Comment 1 Dmitry V. Levin 2003-08-20 12:19:19 MSD
Thanks, fixed in upcoming release (0.5-alt1).
Comment 2 Dmitry V. Levin 2003-08-20 12:19:19 MSD
Thanks, fixed in upcoming release (0.5-alt1).