summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-03 11:21:59 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-03 11:21:59 +0000
commit10a18bbb3cafd8152a8da3fb93516943f86db07c (patch)
treee848a723c66c23b65522e6af05ae1ff0038371d6
parente6383c95c8910f98729642ee08f35ff4bc70c377 (diff)
downloaddrakx-10a18bbb3cafd8152a8da3fb93516943f86db07c.tar
drakx-10a18bbb3cafd8152a8da3fb93516943f86db07c.tar.gz
drakx-10a18bbb3cafd8152a8da3fb93516943f86db07c.tar.bz2
drakx-10a18bbb3cafd8152a8da3fb93516943f86db07c.tar.xz
drakx-10a18bbb3cafd8152a8da3fb93516943f86db07c.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.c10
-rw-r--r--perl-install/install/install2.pm4
-rw-r--r--rescue/tree/etc/fstab2
-rwxr-xr-xrescue/tree/etc/rc.sysinit4
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