[readonly/geninitrd: 538/1068] - need root to access files and make /dev nodes on initrd

draenog draenog at pld-linux.org
Sat Nov 2 19:57:38 CET 2013


commit 034056fdc1201228cc96242b534d86eb092cb029
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Nov 27 17:11:07 2007 +0000

    - need root to access files and make /dev nodes on initrd
    
    svn-id: @9109

 geninitrd | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/geninitrd b/geninitrd
index efa848b..a69cf4d 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1474,6 +1474,11 @@ initrd_gen_procdata() {
 	EOF
 }
 
+# main()
+if [ "$(id -u)" != 0 ]; then
+	die "You need to be root to generate initrd"
+fi
+
 if [ -f /etc/udev/udev.conf -a -x /sbin/initrd-udevd ]; then
 	USE_UDEV=yes
 	. /etc/udev/udev.conf
@@ -1864,7 +1869,6 @@ modules_add_linuxrc "$MODULES"
 #	echo "losetup $rootdev /loopfs$loopFile" >> "$RCFILE"
 #fi
 
-# main generation
 if is_yes "$USE_UDEV"; then
 	initrd_gen_udev
 fi
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list