|
|
|
# $Id: Example.yard,v 1.25 2003/02/13 07:37:48 freesource Exp $
|
|
|
|
# Example.yard
|
|
|
|
#
|
|
|
|
# Creates a minimalistic multi-user runlevel root filesystem with
|
|
|
|
# getty. Tested on Debian stable/unstable and Red Hat 7.3/8.0.
|
|
|
|
# Known to work with Red Hat 7.2 and Mandrake 8.1 with gbootroot
|
|
|
|
# 1.3.6 (glibc 2.2.4). Should work with other distributions by
|
|
|
|
# using the proper inittab and getty. Send in feedback.
|
|
|
|
#
|
|
|
|
# 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. In order to create a non-devfs from a host
|
|
|
|
# system using devfs, either manually mknod /dev/tty[0-2] (major 4 minor 0-2)
|
|
|
|
# or have devfsd automatically make these devices every time the root
|
|
|
|
# filesystem starts.
|
|
|
|
#
|
|
|
|
# On both Red Hat 7.2 and Mandrake 8.1, shadow password had to be 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 explicitly specify intermediate directories unless you
|
|
|
|
# just want to make sure they exist.
|
|
|
|
#
|
|
|
|
# - You don't need to specify shared libraries or loaders because
|
|
|
|
# necessary libraries are detected automatically.
|
|
|
|
#
|
|
|
|
# Control Structures
|
|
|
|
# ------------------
|
|
|
|
#
|
|
|
|
# The if/elsif statement may be used to test for the existence of an
|
|
|
|
# absolute or relative file condition. If the condition is true
|
|
|
|
# than the following statements will be parsed, otherwise additional
|
|
|
|
# conditions are examined. The statements can be specified by any
|
|
|
|
# of the formats rules, but can't be on the same line as the
|
|
|
|
# condition. The \ deliminator is used at the beginning and ending
|
|
|
|
# of the control structure so that the parser knows how to properly
|
|
|
|
# treat the logic.
|
|
|
|
#
|
|
|
|
# This is especially useful for creating templates that work
|
|
|
|
# properly for different distributions allowing portability.
|
|
|
|
# Consider these examples:
|
|
|
|
#
|
|
|
|
# Example 1
|
|
|
|
# ---------
|
|
|
|
#
|
|
|
|
# \
|
|
|
|
# if ( agetty )
|
|
|
|
# /etc/inittab <= Replacements/etc/inittab.example.agetty-rpm
|
|
|
|
# /sbin/agetty
|
|
|
|
# /etc/gettydefs
|
|
|
|
# elsif ( mingetty )
|
|
|
|
# /etc/inittab <= Replacements/etc/inittab.example.mingetty-slack
|
|
|
|
# /sbin/mingetty
|
|
|
|
# /etc/gettydefs
|
|
|
|
# elsif ( getty )
|
|
|
|
# /etc/inittab <= Replacements/etc/inittab.example-deb
|
|
|
|
# /sbin/getty
|
|
|
|
# \
|
|
|
|
#
|
|
|
|
# Example 2
|
|
|
|
# ---------
|
|
|
|
#
|
|
|
|
# \ if ( /etc/pam.d/system-auth )
|
|
|
|
# /etc/pam.d/system-auth \
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# NSS and PAM
|
|
|
|
# -----------
|
|
|
|
# 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".
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
# init - parent of all processes
|
|
|
|
# Choose an inittab farther below in the page.
|
|
|
|
/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
|
|
|
|
/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 some boot scripts may
|
|
|
|
# need them to be here.
|
|
|
|
/bin/echo
|
|
|
|
/bin/mount
|
|
|
|
/bin/umount
|
|
|
|
/bin/cat
|
|
|
|
/bin/hostname
|
|
|
|
/bin/ln
|
|
|
|
/bin/ls
|
|
|
|
/bin/more
|
|
|
|
/bin/mv
|
|
|
|
/usr/bin/find
|
|
|
|
|
|
|
|
##### SHELLS
|
|
|
|
#
|
|
|
|
/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
|
|
|
|
\ if ( /etc/pam.d/system-auth )
|
|
|
|
# RedHat uses this
|
|
|
|
/etc/pam.d/system-auth \
|
|
|
|
|
|
|
|
# /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)
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#===== SLACKWARE and SUSE use agetty:
|
|
|
|
\
|
|
|
|
if ( agetty )
|
|
|
|
|
|
|
|
/etc/inittab <= Replacements/etc/inittab.example-agetty-helper
|
|
|
|
/sbin/agetty
|
|
|
|
/etc/gettydefs
|
|
|
|
#
|
|
|
|
#===== MANDRAKE, REDHAT and many other modern RH based DISTS use mingetty:
|
|
|
|
|
|
|
|
elsif ( mingetty )
|
|
|
|
|
|
|
|
/etc/inittab <= Replacements/etc/inittab.example.mingetty-rpm
|
|
|
|
#/etc/inittab <= Replacements/etc/inittab.example.mingetty-rpm-nodevfs
|
|
|
|
/sbin/mingetty
|
|
|
|
/etc/gettydefs
|
|
|
|
#
|
|
|
|
#===== DEBIAN uses a program called "getty" which is actually agetty in
|
|
|
|
#===== disguise:
|
|
|
|
|
|
|
|
elsif ( getty )
|
|
|
|
|
|
|
|
/etc/inittab <= Replacements/etc/inittab.example-deb
|
|
|
|
#/etc/inittab <= Replacements/etc/inittab.example-deb-nodevfs
|
|
|
|
/sbin/getty
|
|
|
|
\
|
|
|
|
|
|
|
|
# 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.)
|
|
|
|
# Utilities which use them.
|
|
|
|
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
|
|
|
|
/dev
|
|
|
|
/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
|
|
|
|
#
|
|
|
|
# Modules from your host system.
|
|
|
|
# Select the ones required.
|
|
|
|
#
|
|
|
|
#/lib/modules/$RELEASE/*
|
|
|
|
#
|
|
|
|
# User-Mode-Linux modules
|
|
|
|
#
|
|
|
|
# These are modules compiled for the uml kernel version
|
|
|
|
# included with gbootroot. Choose 2.2 or 2.4 depending on
|
|
|
|
# which kernel series your are using with your live host system.
|
|
|
|
# You may either include the modules archive with the root
|
|
|
|
# filesystem as a replacement and "tar xvf", or untar the
|
|
|
|
# modules archive from the host system by mounting it
|
|
|
|
# with "mount -t hostfs none -o \
|
|
|
|
# /usr/lib/bootroot/yard/Replacements/lib/modules /mnt"
|
|
|
|
# and then "tar xvf /mnt/modules-2.4.tar -C /".
|
|
|
|
#
|
|
|
|
# Then "depmod -ae -F /proc/ksyms" from the running uml kernel.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#/modules-2.2.tar <= Replacements/lib/modules/modules-2.2.tar
|
|
|
|
#/modules-2.4.tar <= Replacements/lib/modules/modules-2.4.tar
|
|
|
|
|
|
|
|
##### SYSTEM UTILITIES
|
|
|
|
chmod
|
|
|
|
chown
|
|
|
|
chroot
|
|
|
|
cp
|
|
|
|
df
|
|
|
|
id
|
|
|
|
mkdir
|
|
|
|
pwd
|
|
|
|
rm
|
|
|
|
stty
|
|
|
|
sync
|
|
|
|
uname
|
|
|
|
which
|
|
|
|
ldd
|
|
|
|
du
|
|
|
|
rmdir
|
|
|
|
less
|
|
|
|
dircolors
|
|
|
|
grep
|
|
|
|
egrep
|
|
|
|
mesg
|
|
|
|
tail
|
|
|
|
mknod
|
|
|
|
ps
|
|
|
|
touch
|
|
|
|
whoami
|
|
|
|
diff
|
|
|
|
wc
|
|
|
|
date
|
|
|
|
dmesg
|
|
|
|
tar
|
|
|
|
|
|
|
|
# Editors
|
|
|
|
vi
|
|
|
|
# Small, free, pico replacement.
|
|
|
|
nano
|
|
|
|
|
|
|
|
##### DISK AND FILE SYSTEM UTILITIES
|
|
|
|
fdisk
|
|
|
|
#
|
|
|
|
# ext2 stuff
|
|
|
|
# ----------
|
|
|
|
e2fsck
|
|
|
|
mke2fs
|
|
|
|
tune2fs
|
|
|
|
dumpe2fs
|
|
|
|
debugfs
|
|
|
|
e2image
|
|
|
|
badblocks
|
|
|
|
#
|
|
|
|
# reiserfs stuff
|
|
|
|
# -------------
|
|
|
|
#mkreiserfs
|
|
|
|
#reiserfsck
|
|
|
|
#debugreiserfs
|
|
|
|
#unpack
|
|
|
|
#resize_reiserfs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|