From: Kees Jongenburger Date: Tue, 5 Jun 2012 10:49:50 +0000 (+0000) Subject: Add devmand configuration to /etc. X-Git-Tag: v3.2.1~538 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc-confgen.html?a=commitdiff_plain;h=6417d3e064701f35cc549045c4697c1e5151e936;p=minix.git Add devmand configuration to /etc. --- diff --git a/etc/Makefile b/etc/Makefile index 906e7d526..23e5eef8b 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -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 index 000000000..cd16851cf --- /dev/null +++ b/etc/devmand/scripts/block @@ -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 index 000000000..9b8f0c08c --- /dev/null +++ b/etc/devmand/scripts/singlechar @@ -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 diff --git a/etc/mtree/minix.tree b/etc/mtree/minix.tree index 09215b6e5..dbdecd85e 100644 --- a/etc/mtree/minix.tree +++ b/etc/mtree/minix.tree @@ -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