#!/bin/sh # The normal set of Linux devices is too big for embedded use # (takes too many inodes for small filesystems). # This script makes an adequate subset for most purposes. # This script has to be run as root, and has therefore been # kept short and legible, so security concious people can # read it and confirm that it only does what it should. # Larry Doolittle September 2000 mknod -m 660 fd0 b 2 0; chown root:floppy fd0 mknod -m 660 hda b 3 0; chown root:disk hda mknod -m 660 hdb b 3 64; chown root:disk hdb for part in 1 2 3 4 5 6 7 8; do mknod -m 660 hda$part b 3 $part; chown root:disk hda$part mknod -m 660 hdb$part b 3 $((64+$part)); chown root:disk hdb$part done for ix in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do mknod -m 660 ram$ix b 1 $ix; chown root:disk ram$ix done # tty/console devices for ix in 0 1 2 3 4 5 6 7 8 9 10; do mknod -m 600 tty$ix c 4 $ix; chown root:root tty$ix done mknod -m 600 tty c 5 0; chown root:root tty mknod -m 600 console c 4 0; chown root:root console # xterm needs some tty/pty pairs for ix in 0 1 2 3 4 5 6 7 8 9; do mknod -m 600 ptyp$ix c 2 $ix; chown root:root ptyp$ix mknod -m 600 ttyp$ix c 3 $ix; chown root:root ttyp$ix done # skip 1,2 (kmem) and 1,4 (port); what was 1,6? mknod -m 600 mem c 1 1; chown root:root mem mknod -m 666 null c 1 3; chown root:root null mknod -m 666 zero c 1 5; chown root:root zero mknod -m 644 full c 1 7; chown root:root full mknod -m 644 random c 1 8; chown root:root random mknod -m 644 urandom c 1 9; chown root:root urandom # rodents mknod -m 644 logbm c 10 0; chown root:root logbm mknod -m 644 inportbm c 10 2; chown root:root inportbm