From: Ben Gras Date: Mon, 3 Apr 2006 15:01:43 +0000 (+0000) Subject: script to generate /dev part of proto file. X-Git-Tag: v3.1.2a~85 X-Git-Url: http://zhaoyanbai.com/repos/man.dig.html?a=commitdiff_plain;h=dcb0fee484d362cf9f45ad8afeb3158027ed367c;p=minix.git script to generate /dev part of proto file. --- diff --git a/drivers/memory/ramdisk/Makefile b/drivers/memory/ramdisk/Makefile index 815eae33c..eb47df5d3 100644 --- a/drivers/memory/ramdisk/Makefile +++ b/drivers/memory/ramdisk/Makefile @@ -3,10 +3,12 @@ PROGRAMS=at_wini bios_wini cdprobe dev2name floppy loadramdisk newroot \ pci sh service sysenv +MAKEDEV=/usr/bin/MAKEDEV + all: image.c image.s clean: - rm -f $(PROGRAMS) bintoc image image.c + rm -rf $(PROGRAMS) bintoc image image.c t proto.gen image.c: bintoc image ./bintoc -o $@ image @@ -19,8 +21,8 @@ image.s: image.c bintoc: bintoc.c $(CC) -o $@ bintoc.c -image: proto mtab rc $(PROGRAMS) - mkfs -B1024 image proto || { rm -f image; false; } +image: proto.gen mtab rc $(PROGRAMS) + mkfs -B 2048 image proto.gen 2>/dev/null || { rm -f image; false; } at_wini: ../../at_wini/at_wini install -s ../../$@/$@ $@ @@ -91,6 +93,9 @@ service: ../../../servers/rs/service depend: /usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend +proto.gen: $(MAKEDEV) proto.sh proto + sh -e proto.sh proto.gen + # Include generated dependencies. include .depend diff --git a/drivers/memory/ramdisk/proto b/drivers/memory/ramdisk/proto index 92a7cd60a..e9a14914e 100644 --- a/drivers/memory/ramdisk/proto +++ b/drivers/memory/ramdisk/proto @@ -1,5 +1,5 @@ boot -240 100 +140 310 d--755 0 0 bin d--755 0 0 at_wini ---755 0 0 at_wini @@ -15,63 +15,7 @@ d--755 0 0 sysenv ---755 0 0 sysenv $ dev d--755 0 0 - c0d0 b--222 0 0 3 0 - c0d1 b--222 0 0 3 5 - c0d2 b--222 0 0 3 10 - c0d3 b--222 0 0 3 15 - c0d7 b--222 0 0 3 35 - c0d0p0 b--222 0 0 3 1 - c0d0p1 b--222 0 0 3 2 - c0d0p2 b--222 0 0 3 3 - c0d0p3 b--222 0 0 3 4 - c0d1p0 b--222 0 0 3 6 - c0d1p1 b--222 0 0 3 7 - c0d1p2 b--222 0 0 3 8 - c0d1p3 b--222 0 0 3 9 - c0d2p0 b--222 0 0 3 11 - c0d2p1 b--222 0 0 3 12 - c0d2p2 b--222 0 0 3 13 - c0d2p3 b--222 0 0 3 14 - c0d3p0 b--222 0 0 3 16 - c0d3p1 b--222 0 0 3 17 - c0d3p2 b--222 0 0 3 18 - c0d3p3 b--222 0 0 3 19 - c0d7p0 b--222 0 0 3 36 - c0d7p1 b--222 0 0 3 37 - c0d7p2 b--222 0 0 3 38 - c0d7p3 b--222 0 0 3 39 - c0d0p0s0 b--222 0 0 3 128 - c0d0p1s0 b--222 0 0 3 132 - c0d0p2s0 b--222 0 0 3 136 - c0d0p3s0 b--222 0 0 3 140 - c0d1p0s0 b--222 0 0 3 144 - c0d1p1s0 b--222 0 0 3 148 - c0d1p2s0 b--222 0 0 3 152 - c0d1p3s0 b--222 0 0 3 156 - c0d2p0s0 b--222 0 0 3 160 - c0d2p1s0 b--222 0 0 3 164 - c0d2p2s0 b--222 0 0 3 168 - c0d2p3s0 b--222 0 0 3 172 - c0d3p0s0 b--222 0 0 3 176 - c0d3p1s0 b--222 0 0 3 180 - c0d3p2s0 b--222 0 0 3 184 - c0d3p3s0 b--222 0 0 3 188 - c0d4p0s0 b--222 0 0 3 192 - c0d4p1s0 b--222 0 0 3 196 - c0d4p2s0 b--222 0 0 3 200 - c0d4p3s0 b--222 0 0 3 204 - c0d7p0s0 b--222 0 0 3 240 - c0d7p1s0 b--222 0 0 3 244 - c0d7p2s0 b--222 0 0 3 248 - c0d7p3s0 b--222 0 0 3 252 - fd0 b--222 0 0 2 0 - fd0p0 b--222 0 0 2 112 - fd0p1 b--222 0 0 2 116 - fd0p2 b--222 0 0 2 120 - fd0p3 b--222 0 0 2 124 - log c--222 0 0 4 15 - null c--666 0 0 1 3 - ram b--600 0 0 1 0 +@DEV@ $ etc d--755 0 0 mtab ---644 0 0 mtab diff --git a/drivers/memory/ramdisk/proto.sh b/drivers/memory/ramdisk/proto.sh new file mode 100644 index 000000000..bbf879eb3 --- /dev/null +++ b/drivers/memory/ramdisk/proto.sh @@ -0,0 +1,11 @@ +#!/bin/sh +mkdir t 2>/dev/null || true +cd t +MAKEDEV std 2>/dev/null +rm fd1* fd0p* tcp* eth* ip* udp* tty[pq]* pty* +sed -n '1,/@DEV/p' <../proto | grep -v @DEV@ +ls -aln | grep '^[bc]' | \ +sed -e 's/^[bc]/& /' -e 's/rw-/6/g' -e 's/r--/4/g' \ + -e 's/-w-/2/g' -e 's/---/0/g' | \ +awk '{ printf "\t\t%s %s--%s %d %d %d %d \n", $11, $1, $2, $4, $5, $6, $7; }' +sed -n '/@DEV/,$p' <../proto | grep -v @DEV@