home: hub: mkinitfs

Download patch

ref: 13cfce8f525fcb656044da419e03747892abd174
parent: df2e8ed17d6f7714b25050f3df417d5b97f85cb8
author: Natanael Copa <ncopa@alpinelinux.org>
date: Tue Dec 21 04:08:39 CST 2010

init: mount devices as read-only

--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -138,7 +138,7 @@
 		# wait for usb to settle if needed
 		wait_usb
 		for i in usb floppy cdrom; do
-			mount /media/$i 2>/dev/null || continue
+			mount -o ro /media/$i 2>/dev/null || continue
 			ovl=$(find_ovl /media/$i)
 			[ -f "$ovl" ] && return
 			umount /media/$i 2>/dev/null
@@ -276,7 +276,7 @@
 			;;
 	esac
 	ebegin "Mounting root"
-	retry_mount $KOPT_root $sysroot 2>/dev/null
+	retry_mount -o ro $KOPT_root $sysroot 2>/dev/null
 	eend $?
 	cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
 		if [ "$DIR" != "/" -a "$DIR" != "$sysroot" -a -d "$DIR" ]; then
@@ -302,7 +302,7 @@
 	mount_opts="-t $ALPINE_DEV_FS"
 fi
 
-retry_mount $mount_opts $ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1
+retry_mount -o ro $mount_opts $ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1
 eend $?
 
 # generate apk repositories file 
@@ -329,7 +329,8 @@
 		mount_opts="-t $OVL_DEV_FS"
 	fi
 	
-	retry_mount $mount_opts /dev/$OVL_DEV /media/$OVL_DEV >/dev/null 2>&1
+	retry_mount -o ro $mount_opts /dev/$OVL_DEV /media/$OVL_DEV \
+		>/dev/null 2>&1
 	ovl=$(find_ovl /media/$OVL_DEV)
 else
 	find_ovl_dev