SVN: geninitrd/trunk: geninitrd mod-lvm.sh mod-md.sh mod-nfs.sh mod-suspend.sh mod-uvesafb.sh

arekm arekm at pld-linux.org
Thu Mar 21 08:30:25 CET 2013


Author: arekm
Date: Thu Mar 21 08:30:24 2013
New Revision: 12638

Modified:
   geninitrd/trunk/geninitrd
   geninitrd/trunk/mod-lvm.sh
   geninitrd/trunk/mod-md.sh
   geninitrd/trunk/mod-nfs.sh
   geninitrd/trunk/mod-suspend.sh
   geninitrd/trunk/mod-uvesafb.sh
Log:
Set permission for every mknode call.

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Thu Mar 21 08:30:24 2013
@@ -792,7 +792,7 @@
 			while read major minor blocks dev rest; do
 				node=/dev/$dev
 				mkdir -p ${node%/*}
-				[ -e $node ] || mknod $node b $major $minor
+				[ -e $node ] || mknod -m 660 $node b $major $minor
 			done
 		)
 	EOF
@@ -899,7 +899,7 @@
 		fi
 
 		if [ "$device" -a ! -b $device ]; then
-			mknod $device b $maj $min
+			mknod -m 660 $device b $maj $min
 		fi
 
 		[ -n "$ROOTFSFLAGS" ] && ROOTFSFLAGS="-o $ROOTFSFLAGS"
@@ -1358,11 +1358,11 @@
 
 # mknod'ing the devices instead of copying them works both with and
 # without devfs...
-mknod "$DESTDIR/dev/console" c 5 1
-mknod "$DESTDIR/dev/null" c 1 3
-mknod "$DESTDIR/dev/zero" c 1 5
-mknod "$DESTDIR/dev/random" c 1 8
-mknod "$DESTDIR/dev/urandom" c 1 9
+mknod -m 600 "$DESTDIR/dev/console" c 5 1
+mknod -m 666 "$DESTDIR/dev/null" c 1 3
+mknod -m 666 "$DESTDIR/dev/zero" c 1 5
+mknod -m 666 "$DESTDIR/dev/random" c 1 8
+mknod -m 666 "$DESTDIR/dev/urandom" c 1 9
 
 inst_exec $busybox /bin/busybox
 ln -s busybox $DESTDIR/bin/sh

Modified: geninitrd/trunk/mod-lvm.sh
==============================================================================
--- geninitrd/trunk/mod-lvm.sh	(original)
+++ geninitrd/trunk/mod-lvm.sh	Thu Mar 21 08:30:24 2013
@@ -133,7 +133,7 @@
 
 	if ! is_yes "$dev_mounted"; then
 		inst_d /dev/mapper
-		mknod $DESTDIR/dev/mapper/control c 10 63
+		mknod -m 600 $DESTDIR/dev/mapper/control c 10 63
 		for device in $PVDEVICES; do
 			# if LVM on RAID then device might be copied already in gen_md
 			[ -e "$DESTDIR/dev/$(basename $device)" ] && continue

Modified: geninitrd/trunk/mod-md.sh
==============================================================================
--- geninitrd/trunk/mod-md.sh	(original)
+++ geninitrd/trunk/mod-md.sh	Thu Mar 21 08:30:24 2013
@@ -193,6 +193,6 @@
 
 	# needed to determine md-version
 	if [ "$do_md0" -eq 1 ]; then
-		mknod $DESTDIR/dev/md0 b 9 0
+		mknod -m 660 $DESTDIR/dev/md0 b 9 0
 	fi
 }

Modified: geninitrd/trunk/mod-nfs.sh
==============================================================================
--- geninitrd/trunk/mod-nfs.sh	(original)
+++ geninitrd/trunk/mod-nfs.sh	Thu Mar 21 08:30:24 2013
@@ -57,7 +57,7 @@
 	# use root=/dev/ram0 init=/linuxrc when starting kernel or you will
 	# have problems like init(XX) being child process of swapper(1).
 	verbose "Adding rootfs on NFS support to initrd (dhcp)"
-	mknod "$DESTDIR/dev/urandom" c 1 9
+	mknod -m 644 "$DESTDIR/dev/urandom" c 1 9
 	mkdir "$DESTDIR/newroot"
 	add_linuxrc <<-'EOF'
 		ifconfig lo 127.0.0.1 up

Modified: geninitrd/trunk/mod-suspend.sh
==============================================================================
--- geninitrd/trunk/mod-suspend.sh	(original)
+++ geninitrd/trunk/mod-suspend.sh	Thu Mar 21 08:30:24 2013
@@ -49,7 +49,7 @@
 
 	verbose "Setting up suspend..."
 
-	mknod $DESTDIR/dev/snapshot c 10 231
+	mknod -m 640 $DESTDIR/dev/snapshot c 10 231
 	mkdir -p $DESTDIR${resume_dev%/*}
 	inst $resume_dev $resume_dev
 

Modified: geninitrd/trunk/mod-uvesafb.sh
==============================================================================
--- geninitrd/trunk/mod-uvesafb.sh	(original)
+++ geninitrd/trunk/mod-uvesafb.sh	Thu Mar 21 08:30:24 2013
@@ -41,8 +41,8 @@
 	fi
 
 	verbose "initrd_gen_uvesafb"
-	mknod $DESTDIR/dev/mem c 1 1
-	mknod $DESTDIR/dev/tty1 c 4 1
+	mknod -m 640 $DESTDIR/dev/mem c 1 1
+	mknod -m 600 $DESTDIR/dev/tty1 c 4 1
 	inst_d /sbin
 	inst_exec $v86d /sbin
 }


More information about the pld-cvs-commit mailing list