diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-09-03 11:21:59 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-09-03 11:21:59 +0000 |
commit | 46fab66e7136f738c7f98b1a85981683cbffa704 (patch) | |
tree | e848a723c66c23b65522e6af05ae1ff0038371d6 | |
parent | 479b93c2705a6e8ab24c513de890781cb070e688 (diff) | |
download | drakx-backup-do-not-use-46fab66e7136f738c7f98b1a85981683cbffa704.tar drakx-backup-do-not-use-46fab66e7136f738c7f98b1a85981683cbffa704.tar.gz drakx-backup-do-not-use-46fab66e7136f738c7f98b1a85981683cbffa704.tar.bz2 drakx-backup-do-not-use-46fab66e7136f738c7f98b1a85981683cbffa704.tar.xz drakx-backup-do-not-use-46fab66e7136f738c7f98b1a85981683cbffa704.zip |
mount /dev/{pts,shm} earlier, in stage1 rather than in stage2
(based on pok's idead @mdv but fixed)
-rw-r--r-- | mdk-stage1/init.c | 10 | ||||
-rw-r--r-- | perl-install/install/install2.pm | 4 | ||||
-rw-r--r-- | rescue/tree/etc/fstab | 2 | ||||
-rwxr-xr-x | rescue/tree/etc/rc.sysinit | 4 |
4 files changed, 8 insertions, 12 deletions
diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c index 509dc2cb4..af6aefd2a 100644 --- a/mdk-stage1/init.c +++ b/mdk-stage1/init.c @@ -416,11 +416,17 @@ int main(int argc, char **argv) fatal_error("Unable to mount proc filesystem"); if (mount("none", "/sys", "sysfs", 0, NULL)) fatal_error("Unable to mount sysfs filesystem"); - if (mount("none", "/sys/kernel/debug", "debugfs", 0, "mode=0755,nosuid")) + if (mount("none", "/sys/kernel/debug", "debugfs", MS_NOSUID, "mode=0755")) fatal_error("Unable to mount debugfs filesystem"); if (mount("none", "/dev", "devtmpfs", 0, NULL)) fatal_error("Unable to mount dev filesystem"); - } + mkdir("/dev/pts", 0755); + if (mount("/dev/pts", "/dev/pts", "devpts", MS_NOSUID|MS_NOEXEC, "gid=5,mode=0620")) + fatal_error("Unable to mount /dev/pts devpts filesystem"); + mkdir("/dev/shm", 0755); + if (mount("/dev/shm", "/dev/shm", "tmpfs", MS_NOSUID|MS_NODEV, "mode=1777")) + fatal_error("Unable to mount /dev/shm tmpfs filesystem"); + } /* ignore Control-C and keyboard stop signals */ diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm index 0e12857aa..7bc492e57 100644 --- a/perl-install/install/install2.pm +++ b/perl-install/install/install2.pm @@ -304,10 +304,6 @@ sub start_udev() { mkdir_p("/run/initramfs"); # Start up udev and trigger cold plugs - mkdir("/dev/$_", 0755) foreach qw(pts shm); - run_program::run("mount", "-t", "devpts", "-o", "gid=5,mode=620,noexec,nosuid", "devpts", "/dev/pts"); - run_program::run("mount", "-t", "tmpfs", "-o", "mode=1777,nosuid,nodev", "tmpfs", "/dev/shm"); - mkdir_p("/run/udev/rules.d"); $ENV{UDEVRULESD} = "/run/udev/rules.d"; run_program::run("/usr/lib/systemd/systemd-udevd", "--daemon", "--resolve-names=never"); diff --git a/rescue/tree/etc/fstab b/rescue/tree/etc/fstab index 9280d8ee0..fbafb7801 100644 --- a/rescue/tree/etc/fstab +++ b/rescue/tree/etc/fstab @@ -1,6 +1,4 @@ /dev/ram3 / ext2 defaults 1 1 /dev/fd0 /mnt/floppy auto defaults,noauto 0 0 none /proc proc defaults,noauto,ro 0 0 -devpts /dev/pts devpts gid=5,mode=620,noauto 0 0 -tmpfs /dev/shm tmpfs defaults,noauto 0 0 /dev/cdrom /mnt/cdrom auto defaults,noauto 0 0 diff --git a/rescue/tree/etc/rc.sysinit b/rescue/tree/etc/rc.sysinit index 0bf2c8b58..91c291723 100755 --- a/rescue/tree/etc/rc.sysinit +++ b/rescue/tree/etc/rc.sysinit @@ -15,10 +15,6 @@ mkdir /run mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run mkdir -p /run/udev/rules.d export UDEVRULESD=/run/udev/rules.d -mkdir /dev/pts -mkdir /dev/shm -mount /dev/pts -mount /dev/shm /usr/lib/systemd/systemd-udevd --daemon --resolve-names=never udevadm trigger --type=subsystems --action=add |