]> Zhao Yanbai Git Server - minix.git/commitdiff
Add devmand configuration to /etc.
authorKees Jongenburger <kees.jongenburger@gmail.com>
Tue, 5 Jun 2012 10:49:50 +0000 (10:49 +0000)
committerKees Jongenburger <kees.jongenburger@gmail.com>
Mon, 18 Jun 2012 07:30:45 +0000 (09:30 +0200)
etc/Makefile
etc/devmand/scripts/block [new file with mode: 0755]
etc/devmand/scripts/singlechar [new file with mode: 0755]
etc/mtree/minix.tree

index 906e7d5264549e285f7b24c25888159e5d09a8d9..23e5eef8bd7af311cf43534a991408e2f3bdad6f 100644 (file)
@@ -2,13 +2,26 @@ ETC=/etc/
 USR=/usr/
 USRETC=/usr/etc/
 DEFAULTS=/etc/defaults
+
+#
+# FILES1 are installed in /etc *before* the tree hierarchy is created
+# and can therefore not rely on /etc/groups and /etc/passwd being 
+# present.
 FILES1=group hostname.file inet.conf motd.install mtab profile \
        protocols rc services termcap utmp rc.cd  \
        syslog.conf rc.daemons.dist \
        rs.inet rs.single make.conf system.conf ttys resolv.conf rc.conf \
-       rc.subr rc.subr.minix man.conf shells boot.cfg.default
+       rc.subr rc.subr.minix man.conf shells boot.cfg.default \
+       devmand/scripts/block devmand/scripts/singlechar
 
+#
+# PWFILES are installed in /etc with the 600 permission
+#
 PWFILES=master.passwd
+
+#
+# FILES3 are installed in /usr/etc 755
+#
 FILES3=daily dhcptags.conf rc 
 DEFAULTFILES=rc.conf minix.rc.conf 
 USRFILES=Makefile
@@ -20,6 +33,7 @@ clean::
 install:: installpw    # installpw needed to bootstrap pw db
        @echo "Installing /etc, /usr/etc and /usr/lib.."
        mkdir -p $(ETC) $(USRLIB)
+       mkdir -p $(ETC)/devmand/scripts
        @for f in $(FILES1); do if [ -f $(ETC)/$$f ]; then :; else cp $$f $(ETC)/$$f; chmod 755 $(ETC)/$$f; fi; done
        @for f in $(USRFILES); do cp usr/$$f $(USR)/$$f; chmod 644 $(USR)/$$f; done
        @echo "Making hierarchy.."
diff --git a/etc/devmand/scripts/block b/etc/devmand/scripts/block
new file mode 100755 (executable)
index 0000000..cd16851
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+DEVSUFFIXES="p0 p0s0 p0s1 p0s2 p0s3 p1 p1s0 p1s1 p1s2 p1s3 p2 p2s0 p2s1 p2s2 p2s3 p3 p3s0 p3s1 p3s2 p3s3"
+
+if [ "$1" = up ];
+then
+       mknod /dev/$2 b $3 0;
+       mknod /dev/$2p0 b $3 1;
+       mknod /dev/$2p1 b $3 2;
+       mknod /dev/$2p2 b $3 3;
+       mknod /dev/$2p3 b $3 4;
+       mknod /dev/$2p0s0 b $3 128;
+       mknod /dev/$2p0s1 b $3 129;
+       mknod /dev/$2p0s2 b $3 130;
+       mknod /dev/$2p0s3 b $3 131;
+       mknod /dev/$2p1s0 b $3 132;
+       mknod /dev/$2p1s1 b $3 133;
+       mknod /dev/$2p1s2 b $3 134;
+       mknod /dev/$2p1s3 b $3 135;
+       mknod /dev/$2p2s0 b $3 136;
+       mknod /dev/$2p2s1 b $3 137;
+       mknod /dev/$2p2s2 b $3 138;
+       mknod /dev/$2p2s3 b $3 139;
+       mknod /dev/$2p3s0 b $3 140;
+       mknod /dev/$2p3s1 b $3 141;
+       mknod /dev/$2p3s2 b $3 142;
+       mknod /dev/$2p3s3 b $3 143;
+       echo New USB disk at /dev/$2.
+elif [ "$1" = down ];
+then
+       rm /dev/$2;
+       count=1;
+       for SUF in `echo $DEVSUFFIXES`;
+       do 
+               rm /dev/${2}${SUF};
+               count=$(($count+1));
+       done
+elif 
+       [ "$1" = clean ];
+then
+       rm -f /dev/$2*;
+fi
diff --git a/etc/devmand/scripts/singlechar b/etc/devmand/scripts/singlechar
new file mode 100755 (executable)
index 0000000..9b8f0c0
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ "$1" = up ];
+then
+       mknod /dev/$2 c $3 0
+elif [ "$1" = down ];
+then
+       rm /dev/$2
+elif 
+       [ "$1" = clean ];
+then
+       rm -f /dev/$2*;
+fi
index 09215b6e59cf3ee81156139bb996d2d83ab8c529..dbdecd85e21ff2fbe8926cc6b9625a74485e3b40 100644 (file)
@@ -7,6 +7,7 @@
 /dev/mouse -> /dev/kbdaux
 755 root    operator /etc
 755 root    operator /etc/defaults
+755 root    operator /etc/devmand
 755 root    operator /etc/system.conf.d
 755 root    operator /boot
 755 root    operator /boot/minix_default