]> TLD Linux GIT Repositories - packages/dracut.git/blob - proc_sys_remount.patch
- updated to 059
[packages/dracut.git] / proc_sys_remount.patch
1 diff -urpa dracut-047.orig/modules.d/99base/init.sh dracut-047/modules.d/99base/init.sh
2 --- dracut-047.orig/modules.d/99base/init.sh    2018-02-19 09:00:33.000000000 +0000
3 +++ dracut-047/modules.d/99base/init.sh 2018-03-15 12:11:57.060977050 +0000
4 @@ -277,6 +277,26 @@ getarg 'rd.break=cleanup' -d 'rdbreak=cl
5  source_hook cleanup
6  
7  # By the time we get here, the root filesystem should be mounted.
8 +
9 +# Remount /proc and /sys with options from $NEWROOT/etc/fstab,
10 +# keep defaults just in case.
11 +procopts="nosuid,noexec,nodev,"
12 +sysopts="nosuid,noexec,nodev,"
13 +if [ -f "$NEWROOT/etc/fstab" ] \
14 +    && ! [ -L "$NEWROOT/etc/fstab" ]; then
15 +    while read dev mp fs opts dump fsck; do
16 +        # skip comments
17 +        [ "${dev%%#*}" != "$dev" ] && continue
18 +        if [ "$mp" = "/proc" ]; then
19 +            procopts=$opts
20 +        elif [ "$mp" = "/sys" ]; then
21 +            sysopts=$opts
22 +        fi
23 +    done < "$NEWROOT/etc/fstab"
24 +fi
25 +mount -o remount,$procopts /proc 2>&1
26 +mount -o remount,$sysopts /sys 2>&1
27 +
28  # Try to find init. 
29  for i in "$(getarg real_init=)" "$(getarg init=)" $(getargs rd.distroinit=) /sbin/init; do
30      [ -n "$i" ] || continue