#  $Id$
#  Example.yard
#
#  Creates a minimalistic multi-user runlevel root filesystem with getty.  
#  Tested on Debian unstable/testing,  but should work on other distributions 
#  (Mandrake,  RedHat, etc.) by using the proper inittab and getty.
# 
#  Create either as a normal user or root.
#
#  Works both with and without devfs, i.e devfs=nomount, assuming the correct
#  replacement inittab is used.

#############################################################################
#
# Format rules:
#  - Lines beginning with # or % are comments.
#
#  - Blank lines and whitespace are ignored.
#
#  - Lines of the form "filename1 ->  filename2" will create symbolic (soft)
#    links on the root fs.  For example, if you want sh linked to ash
#    in the root fs you could specify: "/bin/sh -> /bin/ash".
#    The literal output from the last column found when using `ls -s`
#    may be used, or fictional links may be created, for instance,  
#    ashsa -> bash (In this case if /bin/bash exists on the system the link 
#    would be /bin/ashsa -> /bin/bash, otherwise /asha -> /bash)
#    (There is no way to specify hardlinks, though hard linked files
#    that exist on the hard disk will be hard linked.)
#
#  - Lines of the form "filename1 <= Replacements/pathto_filename2"
#    will cause filename2 to be copied to filename1 on the root fs.
#    This is useful for specifying trimmed-down replacements for
#    /etc/passwd, /etc/inittab, etc.  For the above example, filename2 
#    is found in its real path below the Replacements directory which is 
#    found in the default Replacements path of $HOME/yard/Replacements.
#    Replacements may be specified in their absolute or relative paths 
#    (found using $PATH). 
#
#  - User defined paths may be specified in the Path Box 
#    (Edit->Settings->Path).  These paths may be used to search for the 
#    relative paths for Replacements, links and files.
#     
#  - Glob designations (?, * and []) are generally allowed, eg /dev/hd[ab]*
#    Wildcards are not allowed in link specs or replacement specs.
#
#  - The $RELEASE variable which may be used to locate the modules directory 
#    can come from one of three sources,  the kernel version returned from a 
#    selected kernel in the main section, 
#    a user defined kernel version in the ABS, or the value of `uname -r` 
#    returned automatically when the other two sources aren't specified.
#
#    You don't need to specify shared libraries or loaders because
#    necessary libraries are detected automatically.  

#    You may choose between two behaviors for the treatment of NSS and PAM 
#    libraries.  The old Yard behavior assumes that only the user knows which
#    service modules they want to include in the file set, and tests 
#    (see Tests menu) may be run on the configuration files to show what isn't
#    provided, so that the user can include the missing modules manually by 
#    editing the template, but the user still needs to figure out any 
#    dependencies since the modules are dynamically loaded.
#
#    The new Yard behavior (default) assumes that the user does know what they
#    want based on what the user puts in the NSS (nsswitch.conf) and PAM 
#    (pam.conf or pam.d/*) configuration files.  The configuration files are 
#    then parsed and the corresponding service modules are included in the 
#    file set if they exist on the host system, tests (see Tests menu) can be 
#    run to find out which ones don't exist.   The service modules are checked
#    for library dependencies.  What this means is that the user only needs
#    to specify the configuration files in the template, and doesn't need to 
#    be concerned with the service modules or libraries involved.  The new 
#    behavior is recommended, and won't effect the file set even if the 
#    requirements are already included in the template.  If desired, the old 
#    behavior may be regained by switching off Edit->Settings->"NSS Conf" 
#    and Edit->Settings->"PAM Conf".
#
#    You don't need to explicitly specify intermediate directories unless you
#    just want to make sure they exist.
#
##############################################################################

# init - parent of all processes
# Choose an inittab to compliment the traditional init in the page below.
/sbin/init 		   	
telinit
/sbin/shutdown
/sbin/halt
/etc/init.d/halt   <=   Replacements/etc/init.d/halt.example
/sbin/reboot   
/etc/init.d/reboot   <=   Replacements/etc/init.d/reboot.example
/etc/init.d/rc   <=   Replacements/etc/init.d/rc.example
/etc/init.d/rcS   <=  Replacements/etc/init.d/rcS.example
/sbin/swapon 

# Login stuff
/bin/login 
/sbin/sulogin # used by inittab.debian-min
/etc/securetty <= Replacements/etc/securetty.example
/root/.bashrc <= Replacements/root/.bashrc.debian
/root/.profile <= Replacements/root/.profile.debian
/home/user/.bashrc <= Replacements/home/user/.bashrc.debian
/home/user/.bash_profile <= Replacements/home/user/.bash_profile.debian
/etc/hostname <= Replacements/etc/hostname
/etc/motd <= Replacements/etc/motd

# login and mount stuff
#
/etc/fstab	<=  Replacements/etc/fstab.example
#
/etc/issue # nice to have
#
# No password for root or user.
/etc/group <= Replacements/etc/group.example	
/etc/passwd <= Replacements/etc/passwd.example
#
# Shadow password  root=root user=user
#/etc/group <= Replacements/etc/group.debian	
#/etc/passwd <= Replacements/etc/passwd.debian
#/etc/shadow <= Replacements/etc/shadow.debian
/etc/login.defs

#  Specify these binaries absolutely because boot scripts need them to be here.
/bin/echo # for inittab.debian.sample
/bin/mount 
/bin/umount
/bin/cat
/bin/hostname		   	
/bin/ln			   	
/bin/ls			   	
/bin/more
/bin/mv			   	
/usr/bin/find

#####  SHELLS
#    Bash is huge and requires libncurses.so.
#    Many people use a smaller lightweight shell, like ash or kiss,
#    and use that instead.
/bin/sh -> bash 
/bin/sash 
#
/etc/profile		    
/etc/shells # Make sure all included shells are listed.

#   PROVISIONS FOR PAM: 
/etc/pam.d/other
/etc/pam.d/login
# /etc/pam.conf

#   PROVISIONS FOR NSS
#   If you use the old libc5, or uClibc you don't need this.  
#   Comment out this line.
#
/etc/nsswitch.conf <=  Replacements/etc/nsswitch.conf.example

##### INITTAB and GETTY
# These inittab and getty pairs are based on major distributions.
# If your distribution isn't mentioned here, one of these inittabs may 
# still work.  Check your /etc/inittab to confirm, or create a new inittab 
# replacement and edit as required.  Some gettys require /etc/gettydefs.
#
# Choose the *-nodevfs version if you don't want to use the device fs 
# (devfs=nomount)
#
#===== DEBIAN uses a program called "getty" which is actually agetty in 
#===== disguise:
/etc/inittab	<= Replacements/etc/inittab.example-deb
#/etc/inittab	<= Replacements/etc/inittab.example-deb-nodevfs
/sbin/getty
#
#===== MANDRAKE, REDHAT  and many other modern RH based DISTS use mingetty:
#/etc/inittab	<= Replacements/etc/inittab.example.mingetty-rpm
#/etc/inittab	<= Replacements/etc/inittab.example.mingetty-rpm-nodevfs
#/sbin/mingetty
#/etc/gettydefs
#
#===== SLACKWARE uses agetty:
#/etc/inittab	<= Replacements/etc/inittab.example.agetty-slack
#/etc/inittab	<= Replacements/etc/inittab.example.agetty-slack-nodevfs
#/sbin/agetty
#/etc/gettydefs

# Devices - If devfs isn't desired use the kernel option devfs=nomount 
/dev/console
/dev/null
/dev/zero
/dev/tty[0-2]
#
/dev/mem
/dev/kmem
/dev/port
/dev/random
/dev/urandom
/dev/ram[0-2]
/dev/loop[0-2]
/dev/fd0

#####  utmp and wtmp.  
# Made by rcS if they don't exist.
w
last

#####  terminfo entries for programs which need terminal capabilities like 
#####  vi and nano.
/usr/share/terminfo/v/vt100    
/usr/share/terminfo/l/linux  
# The old way
#/etc/termcap <= Replacements/etc/termcap
reset

# Designate a keyboard map of choice if you want to load one for 
# the text console.  Edit rcS to point to it.
# /usr/share/keymaps/i386/qwerty/defkeymap.kmap.gz
# /usr/lib/kbd/keymaps/i386/qwerty/defkeymap.kmap.gz

#####  Empty directories
/proc               
/tmp                
/var/tmp
/var/log
/var/run

##### Special links
/etc/mtab -> /proc/mounts

#####  MODULES and support programs for them.
insmod
rmmod
lsmod
depmod
modprobe
/etc/modules.conf
#
#       The actual modules.  You probably want to be more selective than this.
#       Do a "lsmod" and include the modules you use.
#/lib/modules/$RELEASE/*/*.o

#####  ESSENTIAL SYSTEM UTILITIES
# (your rescue disk may not boot if these are not present.)
chmod		   	
chown
chroot
cp			   	
df			   	
id
mkdir		   	
pwd
rm
stty		   	
sync          
uname

#####  NON-ESSENTIAL BUT USEFUL UTILITIES
which
ldd
du			   	
rmdir
less
dircolors
grep         
tail       
mknod		   	
ps			   	
touch		   	
whoami
diff
wc
date
dmesg
	   	
# Editors
vi
# Small, free, pico replacement.
nano

#####  DISK AND FILE SYSTEM UTILITIES
fdisk
e2fsck
mke2fs
tune2fs
dumpe2fs
debugfs
e2image
badblocks