ref: e98ece99187961b8eacf7cb53726ba35d72e7387
parent: e282075798a15081a5aca8d8a5ad8c5ffe406cc2
author: Natanael Copa <ncopa@alpinelinux.org>
date: Fri Dec 3 03:34:44 CST 2010
init: respect mount options in /etc/fstab for alpine_dev ref #477 http://redmine.alpinelinux.org/issues/477
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -400,6 +400,15 @@
ALPINE_MNT="$new_mnt"
fi
+# let user set ALPINE_MNT as readonly in fstab
+if [ -f $sysroot/etc/fstab ]; then
+ mountopts=$(awk "\$2 == \"$ALPINE_MNT\" { print \$4 }" \
+ $sysroot/etc/fstab)
+ if [ -n "$mountopts" ]; then
+ mount -o remount,$mountopts $ALPINE_MNT
+ fi
+fi
+
# copy keys so apk finds them. apk looks for stuff relative --root
mkdir -p $sysroot/etc/apk/keys/
cp -a /etc/apk/keys $sysroot/etc/apk