From 2615111fc67aa8a1f6ee01bbb65c5e459bb07652 Mon Sep 17 00:00:00 2001 From: Achim Gottinger Date: Mon, 9 Apr 2001 03:03:13 +0000 Subject: *** empty log message *** --- sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents | 334 ++++++++ .../files/yard-2.0/etc/Bootdisk_Contents.devices | 185 +++++ sys-apps/yard/files/yard-2.0/etc/Config.pl | 175 +++++ .../yard-2.0/etc/Replacements/etc/bootdisk_motd | 1 + .../yard/files/yard-2.0/etc/Replacements/etc/fstab | 4 + .../files/yard-2.0/etc/Replacements/etc/gettydefs | 1 + .../files/yard-2.0/etc/Replacements/etc/inittab | 17 + .../yard-2.0/etc/Replacements/etc/inittab.agetty | 21 + .../yard-2.0/etc/Replacements/etc/nsswitch.conf | 16 + .../files/yard-2.0/etc/Replacements/etc/pam.conf | 8 + .../files/yard-2.0/etc/Replacements/etc/passwd | 4 + .../files/yard-2.0/etc/Replacements/etc/profile | 2 + .../yard/files/yard-2.0/etc/Replacements/etc/rc | 23 + .../files/yard-2.0/etc/Replacements/etc/termcap | 17 + .../files/yard-2.0/etc/Replacements/etc/ttytype | 6 + .../files/yard-2.0/etc/Replacements/pam.d/other | 8 + .../files/yard-2.0/etc/Replacements/root/profile | 18 + sys-apps/yard/files/yard-2.0/sbin/check_root_fs | 605 +++++++++++++++ sys-apps/yard/files/yard-2.0/sbin/make_root_fs | 829 ++++++++++++++++++++ sys-apps/yard/files/yard-2.0/sbin/mklibs.sh | 863 +++++++++++++++++++++ .../yard/files/yard-2.0/sbin/reduce_libs_root_fs | 8 + .../yard/files/yard-2.0/sbin/write_rescue_disk | 563 ++++++++++++++ sys-apps/yard/yard-2.0-r1.ebuild | 67 ++ 23 files changed, 3775 insertions(+) create mode 100644 sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents create mode 100644 sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents.devices create mode 100644 sys-apps/yard/files/yard-2.0/etc/Config.pl create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/bootdisk_motd create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/fstab create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/gettydefs create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab.agetty create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/nsswitch.conf create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/pam.conf create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/passwd create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/profile create mode 100755 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/rc create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/termcap create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/etc/ttytype create mode 100644 sys-apps/yard/files/yard-2.0/etc/Replacements/pam.d/other create mode 100755 sys-apps/yard/files/yard-2.0/etc/Replacements/root/profile create mode 100644 sys-apps/yard/files/yard-2.0/sbin/check_root_fs create mode 100644 sys-apps/yard/files/yard-2.0/sbin/make_root_fs create mode 100755 sys-apps/yard/files/yard-2.0/sbin/mklibs.sh create mode 100755 sys-apps/yard/files/yard-2.0/sbin/reduce_libs_root_fs create mode 100644 sys-apps/yard/files/yard-2.0/sbin/write_rescue_disk create mode 100644 sys-apps/yard/yard-2.0-r1.ebuild (limited to 'sys-apps/yard') diff --git a/sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents b/sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents new file mode 100644 index 000000000000..15110ff5ab87 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents @@ -0,0 +1,334 @@ +# -*- Mode: Fundamental -*- +# +# This is a pared-down Bootdisk_Contents file for use with Yard. +# You can certainly boot with fewer files than this, but you +# probably wouldn't want to. With these you can at least +# do some basic disk maintenance. +# +# Format rules: +# - Lines beginning with # or % are comments. +# +# - Blank lines and whitespace may be used freely. +# +# - Filenames may be either relative or absolute. +# +# - Lines of the form "filename1 -> filename2" will create +# links on the boot disk. Eg, if you want sh linked to bash +# on the bootdisk, you can specify: "/bin/sh -> /bin/bash" +# +# - Lines of the form "filename1 <= filename2" +# will cause filename2 (relative to the current working directory) +# to be copied to filename1 on the boot disk. This is useful for +# specifying trimmed-down replacements for /etc/passwd, /etc/inittab, etc. +# +# - Wildcards (? and *) are generally allowed, eg /dev/* +# Wildcards are not allowed in link specs or replacement specs. +# +# You don't need to specify shared libraries or ld.so*. The +# script will detect dependencies (via ldd) and include them +# automatically. +# +# You don't need to explicitly specify intermediate directories +# unless you just want them to exist. +# + +# Specify these absolutely because boot scripts need them to be here. +/bin/cat +/bin/hostname +/bin/ln +/bin/login +/bin/ls +/bin/mv + +# Use ash or some suitably minimal shell +/bin/sh -> ash + +/sbin/agetty +/sbin/halt +/sbin/init +#/sbin/ldconfig +/bin/mount +/sbin/reboot +/sbin/shutdown +/sbin/swapoff +/sbin/swapon + +# Devices +#/dev/ftape /dev/nftape +/dev/mem /dev/kmem +/dev/null +/dev/zero +/dev/rd/0 +/dev/console +/dev/tty[0-9] +/dev/fd0* +/dev/cu* + +/etc/group +#/etc/issue + +# These get replaced with their pared-down versions +# in the Replacements subdirectory. +/etc/fstab <= Replacements/etc/fstab +/etc/inittab <= Replacements/etc/inittab.agetty +/etc/motd <= Replacements/etc/bootdisk_motd +/etc/passwd <= Replacements/etc/passwd +/etc/rc <= Replacements/etc/rc +/etc/ttytype <= Replacements/etc/ttytype +/etc/gettydefs <= Replacements/etc/gettydefs +/etc/profile <= Replacements/etc/profile + +# PROVISIONS FOR PAM: +/etc/pam.conf <= ./Replacements/etc/pam.conf +/lib/security/pam_permit.so + +# PROVISIONS FOR NSS +# If you use old libc5, you don't need this. Comment out these lines. +# +/etc/nsswitch.conf <= ./Replacements/etc/nsswitch.conf +# Check your version of libc and comment out the one you don't need: +/lib/libnss_files.so.2 # If you use use libc-2.1.X + +# Initialize utmp and wtmp. Set up links for any old-style programs +# that expect them in /etc. +/etc/utmp -> /var/run/utmp +/var/run/utmp <= /dev/null # This clears utmp + +/etc/wtmp -> /var/log/wtmp +/var/log/wtmp <= /dev/null + +# Directories with nothing otherwise in them: +/mnt +/proc +/tmp +/root +/dev/pts + +# Utilities. The script will figure out their locations. +bzip2 +chmod +chown +chroot +cp +date +dd +df +du +#e2fsck +fdisk +find +#fsck +#fsck.ext2 +grep +gunzip +gzip +less +mkdir +#mke2fs +#mkfs +#mkfs.ext2 +#mknod +mkreiserfs +#mkswap +#passwd +pwd +reboot +rm +stty +sync +tar +tail +touch +tr +umount +uname +whoami +wc + +##### End of Bootdisk_Contents + +/dev/hda <= Replacements/dev/hda +/dev/hda1 <= Replacements/dev/hda1 +/dev/hda10 <= Replacements/dev/hda10 +/dev/hda11 <= Replacements/dev/hda11 +/dev/hda12 <= Replacements/dev/hda12 +/dev/hda13 <= Replacements/dev/hda13 +/dev/hda14 <= Replacements/dev/hda14 +/dev/hda15 <= Replacements/dev/hda15 +/dev/hda16 <= Replacements/dev/hda16 +/dev/hda17 <= Replacements/dev/hda17 +/dev/hda18 <= Replacements/dev/hda18 +/dev/hda19 <= Replacements/dev/hda19 +/dev/hda2 <= Replacements/dev/hda2 +/dev/hda20 <= Replacements/dev/hda20 +/dev/hda3 <= Replacements/dev/hda3 +/dev/hda4 <= Replacements/dev/hda4 +/dev/hda5 <= Replacements/dev/hda5 +/dev/hda6 <= Replacements/dev/hda6 +/dev/hda7 <= Replacements/dev/hda7 +/dev/hda8 <= Replacements/dev/hda8 +/dev/hda9 <= Replacements/dev/hda9 +/dev/hdb <= Replacements/dev/hdb +/dev/hdb1 <= Replacements/dev/hdb1 +/dev/hdb10 <= Replacements/dev/hdb10 +/dev/hdb11 <= Replacements/dev/hdb11 +/dev/hdb12 <= Replacements/dev/hdb12 +/dev/hdb13 <= Replacements/dev/hdb13 +/dev/hdb14 <= Replacements/dev/hdb14 +/dev/hdb15 <= Replacements/dev/hdb15 +/dev/hdb16 <= Replacements/dev/hdb16 +/dev/hdb17 <= Replacements/dev/hdb17 +/dev/hdb18 <= Replacements/dev/hdb18 +/dev/hdb19 <= Replacements/dev/hdb19 +/dev/hdb2 <= Replacements/dev/hdb2 +/dev/hdb20 <= Replacements/dev/hdb20 +/dev/hdb3 <= Replacements/dev/hdb3 +/dev/hdb4 <= Replacements/dev/hdb4 +/dev/hdb5 <= Replacements/dev/hdb5 +/dev/hdb6 <= Replacements/dev/hdb6 +/dev/hdb7 <= Replacements/dev/hdb7 +/dev/hdb8 <= Replacements/dev/hdb8 +/dev/hdb9 <= Replacements/dev/hdb9 +/dev/hdc <= Replacements/dev/hdc +/dev/hdc1 <= Replacements/dev/hdc1 +/dev/hdc10 <= Replacements/dev/hdc10 +/dev/hdc11 <= Replacements/dev/hdc11 +/dev/hdc12 <= Replacements/dev/hdc12 +/dev/hdc13 <= Replacements/dev/hdc13 +/dev/hdc14 <= Replacements/dev/hdc14 +/dev/hdc15 <= Replacements/dev/hdc15 +/dev/hdc16 <= Replacements/dev/hdc16 +/dev/hdc17 <= Replacements/dev/hdc17 +/dev/hdc18 <= Replacements/dev/hdc18 +/dev/hdc19 <= Replacements/dev/hdc19 +/dev/hdc2 <= Replacements/dev/hdc2 +/dev/hdc20 <= Replacements/dev/hdc20 +/dev/hdc3 <= Replacements/dev/hdc3 +/dev/hdc4 <= Replacements/dev/hdc4 +/dev/hdc5 <= Replacements/dev/hdc5 +/dev/hdc6 <= Replacements/dev/hdc6 +/dev/hdc7 <= Replacements/dev/hdc7 +/dev/hdc8 <= Replacements/dev/hdc8 +/dev/hdc9 <= Replacements/dev/hdc9 +/dev/hdd <= Replacements/dev/hdd +/dev/hdd1 <= Replacements/dev/hdd1 +/dev/hdd10 <= Replacements/dev/hdd10 +/dev/hdd11 <= Replacements/dev/hdd11 +/dev/hdd12 <= Replacements/dev/hdd12 +/dev/hdd13 <= Replacements/dev/hdd13 +/dev/hdd14 <= Replacements/dev/hdd14 +/dev/hdd15 <= Replacements/dev/hdd15 +/dev/hdd16 <= Replacements/dev/hdd16 +/dev/hdd17 <= Replacements/dev/hdd17 +/dev/hdd18 <= Replacements/dev/hdd18 +/dev/hdd19 <= Replacements/dev/hdd19 +/dev/hdd2 <= Replacements/dev/hdd2 +/dev/hdd20 <= Replacements/dev/hdd20 +/dev/hdd3 <= Replacements/dev/hdd3 +/dev/hdd4 <= Replacements/dev/hdd4 +/dev/hdd5 <= Replacements/dev/hdd5 +/dev/hdd6 <= Replacements/dev/hdd6 +/dev/hdd7 <= Replacements/dev/hdd7 +/dev/hdd8 <= Replacements/dev/hdd8 +/dev/hdd9 <= Replacements/dev/hdd9 +/dev/hde <= Replacements/dev/hde +/dev/hde1 <= Replacements/dev/hde1 +/dev/hde10 <= Replacements/dev/hde10 +/dev/hde11 <= Replacements/dev/hde11 +/dev/hde12 <= Replacements/dev/hde12 +/dev/hde13 <= Replacements/dev/hde13 +/dev/hde14 <= Replacements/dev/hde14 +/dev/hde15 <= Replacements/dev/hde15 +/dev/hde16 <= Replacements/dev/hde16 +/dev/hde17 <= Replacements/dev/hde17 +/dev/hde18 <= Replacements/dev/hde18 +/dev/hde19 <= Replacements/dev/hde19 +/dev/hde2 <= Replacements/dev/hde2 +/dev/hde20 <= Replacements/dev/hde20 +/dev/hde3 <= Replacements/dev/hde3 +/dev/hde4 <= Replacements/dev/hde4 +/dev/hde5 <= Replacements/dev/hde5 +/dev/hde6 <= Replacements/dev/hde6 +/dev/hde7 <= Replacements/dev/hde7 +/dev/hde8 <= Replacements/dev/hde8 +/dev/hde9 <= Replacements/dev/hde9 +/dev/hdf <= Replacements/dev/hdf +/dev/hdf1 <= Replacements/dev/hdf1 +/dev/hdf10 <= Replacements/dev/hdf10 +/dev/hdf11 <= Replacements/dev/hdf11 +/dev/hdf12 <= Replacements/dev/hdf12 +/dev/hdf13 <= Replacements/dev/hdf13 +/dev/hdf14 <= Replacements/dev/hdf14 +/dev/hdf15 <= Replacements/dev/hdf15 +/dev/hdf16 <= Replacements/dev/hdf16 +/dev/hdf17 <= Replacements/dev/hdf17 +/dev/hdf18 <= Replacements/dev/hdf18 +/dev/hdf19 <= Replacements/dev/hdf19 +/dev/hdf2 <= Replacements/dev/hdf2 +/dev/hdf20 <= Replacements/dev/hdf20 +/dev/hdf3 <= Replacements/dev/hdf3 +/dev/hdf4 <= Replacements/dev/hdf4 +/dev/hdf5 <= Replacements/dev/hdf5 +/dev/hdf6 <= Replacements/dev/hdf6 +/dev/hdf7 <= Replacements/dev/hdf7 +/dev/hdf8 <= Replacements/dev/hdf8 +/dev/hdf9 <= Replacements/dev/hdf9 +/dev/hdg <= Replacements/dev/hdg +/dev/hdg1 <= Replacements/dev/hdg1 +/dev/hdg10 <= Replacements/dev/hdg10 +/dev/hdg11 <= Replacements/dev/hdg11 +/dev/hdg12 <= Replacements/dev/hdg12 +/dev/hdg13 <= Replacements/dev/hdg13 +/dev/hdg14 <= Replacements/dev/hdg14 +/dev/hdg15 <= Replacements/dev/hdg15 +/dev/hdg16 <= Replacements/dev/hdg16 +/dev/hdg17 <= Replacements/dev/hdg17 +/dev/hdg18 <= Replacements/dev/hdg18 +/dev/hdg19 <= Replacements/dev/hdg19 +/dev/hdg2 <= Replacements/dev/hdg2 +/dev/hdg20 <= Replacements/dev/hdg20 +/dev/hdg3 <= Replacements/dev/hdg3 +/dev/hdg4 <= Replacements/dev/hdg4 +/dev/hdg5 <= Replacements/dev/hdg5 +/dev/hdg6 <= Replacements/dev/hdg6 +/dev/hdg7 <= Replacements/dev/hdg7 +/dev/hdg8 <= Replacements/dev/hdg8 +/dev/hdg9 <= Replacements/dev/hdg9 +/dev/hdh <= Replacements/dev/hdh +/dev/hdh1 <= Replacements/dev/hdh1 +/dev/hdh10 <= Replacements/dev/hdh10 +/dev/hdh11 <= Replacements/dev/hdh11 +/dev/hdh12 <= Replacements/dev/hdh12 +/dev/hdh13 <= Replacements/dev/hdh13 +/dev/hdh14 <= Replacements/dev/hdh14 +/dev/hdh15 <= Replacements/dev/hdh15 +/dev/hdh16 <= Replacements/dev/hdh16 +/dev/hdh17 <= Replacements/dev/hdh17 +/dev/hdh18 <= Replacements/dev/hdh18 +/dev/hdh19 <= Replacements/dev/hdh19 +/dev/hdh2 <= Replacements/dev/hdh2 +/dev/hdh20 <= Replacements/dev/hdh20 +/dev/hdh3 <= Replacements/dev/hdh3 +/dev/hdh4 <= Replacements/dev/hdh4 +/dev/hdh5 <= Replacements/dev/hdh5 +/dev/hdh6 <= Replacements/dev/hdh6 +/dev/hdh7 <= Replacements/dev/hdh7 +/dev/hdh8 <= Replacements/dev/hdh8 +/dev/hdh9 <= Replacements/dev/hdh9 +/dev/scd0 <= Replacements/dev/scd0 +/dev/scd1 <= Replacements/dev/scd1 +/dev/scd10 <= Replacements/dev/scd10 +/dev/scd11 <= Replacements/dev/scd11 +/dev/scd12 <= Replacements/dev/scd12 +/dev/scd13 <= Replacements/dev/scd13 +/dev/scd14 <= Replacements/dev/scd14 +/dev/scd15 <= Replacements/dev/scd15 +/dev/scd16 <= Replacements/dev/scd16 +/dev/scd2 <= Replacements/dev/scd2 +/dev/scd3 <= Replacements/dev/scd3 +/dev/scd4 <= Replacements/dev/scd4 +/dev/scd5 <= Replacements/dev/scd5 +/dev/scd6 <= Replacements/dev/scd6 +/dev/scd7 <= Replacements/dev/scd7 +/dev/scd8 <= Replacements/dev/scd8 +/dev/scd9 <= Replacements/dev/scd9 diff --git a/sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents.devices b/sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents.devices new file mode 100644 index 000000000000..d806ec3cb6b0 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Bootdisk_Contents.devices @@ -0,0 +1,185 @@ +/dev/hda <= Replacements/dev/hda +/dev/hda1 <= Replacements/dev/hda1 +/dev/hda10 <= Replacements/dev/hda10 +/dev/hda11 <= Replacements/dev/hda11 +/dev/hda12 <= Replacements/dev/hda12 +/dev/hda13 <= Replacements/dev/hda13 +/dev/hda14 <= Replacements/dev/hda14 +/dev/hda15 <= Replacements/dev/hda15 +/dev/hda16 <= Replacements/dev/hda16 +/dev/hda17 <= Replacements/dev/hda17 +/dev/hda18 <= Replacements/dev/hda18 +/dev/hda19 <= Replacements/dev/hda19 +/dev/hda2 <= Replacements/dev/hda2 +/dev/hda20 <= Replacements/dev/hda20 +/dev/hda3 <= Replacements/dev/hda3 +/dev/hda4 <= Replacements/dev/hda4 +/dev/hda5 <= Replacements/dev/hda5 +/dev/hda6 <= Replacements/dev/hda6 +/dev/hda7 <= Replacements/dev/hda7 +/dev/hda8 <= Replacements/dev/hda8 +/dev/hda9 <= Replacements/dev/hda9 +/dev/hdb <= Replacements/dev/hdb +/dev/hdb1 <= Replacements/dev/hdb1 +/dev/hdb10 <= Replacements/dev/hdb10 +/dev/hdb11 <= Replacements/dev/hdb11 +/dev/hdb12 <= Replacements/dev/hdb12 +/dev/hdb13 <= Replacements/dev/hdb13 +/dev/hdb14 <= Replacements/dev/hdb14 +/dev/hdb15 <= Replacements/dev/hdb15 +/dev/hdb16 <= Replacements/dev/hdb16 +/dev/hdb17 <= Replacements/dev/hdb17 +/dev/hdb18 <= Replacements/dev/hdb18 +/dev/hdb19 <= Replacements/dev/hdb19 +/dev/hdb2 <= Replacements/dev/hdb2 +/dev/hdb20 <= Replacements/dev/hdb20 +/dev/hdb3 <= Replacements/dev/hdb3 +/dev/hdb4 <= Replacements/dev/hdb4 +/dev/hdb5 <= Replacements/dev/hdb5 +/dev/hdb6 <= Replacements/dev/hdb6 +/dev/hdb7 <= Replacements/dev/hdb7 +/dev/hdb8 <= Replacements/dev/hdb8 +/dev/hdb9 <= Replacements/dev/hdb9 +/dev/hdc <= Replacements/dev/hdc +/dev/hdc1 <= Replacements/dev/hdc1 +/dev/hdc10 <= Replacements/dev/hdc10 +/dev/hdc11 <= Replacements/dev/hdc11 +/dev/hdc12 <= Replacements/dev/hdc12 +/dev/hdc13 <= Replacements/dev/hdc13 +/dev/hdc14 <= Replacements/dev/hdc14 +/dev/hdc15 <= Replacements/dev/hdc15 +/dev/hdc16 <= Replacements/dev/hdc16 +/dev/hdc17 <= Replacements/dev/hdc17 +/dev/hdc18 <= Replacements/dev/hdc18 +/dev/hdc19 <= Replacements/dev/hdc19 +/dev/hdc2 <= Replacements/dev/hdc2 +/dev/hdc20 <= Replacements/dev/hdc20 +/dev/hdc3 <= Replacements/dev/hdc3 +/dev/hdc4 <= Replacements/dev/hdc4 +/dev/hdc5 <= Replacements/dev/hdc5 +/dev/hdc6 <= Replacements/dev/hdc6 +/dev/hdc7 <= Replacements/dev/hdc7 +/dev/hdc8 <= Replacements/dev/hdc8 +/dev/hdc9 <= Replacements/dev/hdc9 +/dev/hdd <= Replacements/dev/hdd +/dev/hdd1 <= Replacements/dev/hdd1 +/dev/hdd10 <= Replacements/dev/hdd10 +/dev/hdd11 <= Replacements/dev/hdd11 +/dev/hdd12 <= Replacements/dev/hdd12 +/dev/hdd13 <= Replacements/dev/hdd13 +/dev/hdd14 <= Replacements/dev/hdd14 +/dev/hdd15 <= Replacements/dev/hdd15 +/dev/hdd16 <= Replacements/dev/hdd16 +/dev/hdd17 <= Replacements/dev/hdd17 +/dev/hdd18 <= Replacements/dev/hdd18 +/dev/hdd19 <= Replacements/dev/hdd19 +/dev/hdd2 <= Replacements/dev/hdd2 +/dev/hdd20 <= Replacements/dev/hdd20 +/dev/hdd3 <= Replacements/dev/hdd3 +/dev/hdd4 <= Replacements/dev/hdd4 +/dev/hdd5 <= Replacements/dev/hdd5 +/dev/hdd6 <= Replacements/dev/hdd6 +/dev/hdd7 <= Replacements/dev/hdd7 +/dev/hdd8 <= Replacements/dev/hdd8 +/dev/hdd9 <= Replacements/dev/hdd9 +/dev/hde <= Replacements/dev/hde +/dev/hde1 <= Replacements/dev/hde1 +/dev/hde10 <= Replacements/dev/hde10 +/dev/hde11 <= Replacements/dev/hde11 +/dev/hde12 <= Replacements/dev/hde12 +/dev/hde13 <= Replacements/dev/hde13 +/dev/hde14 <= Replacements/dev/hde14 +/dev/hde15 <= Replacements/dev/hde15 +/dev/hde16 <= Replacements/dev/hde16 +/dev/hde17 <= Replacements/dev/hde17 +/dev/hde18 <= Replacements/dev/hde18 +/dev/hde19 <= Replacements/dev/hde19 +/dev/hde2 <= Replacements/dev/hde2 +/dev/hde20 <= Replacements/dev/hde20 +/dev/hde3 <= Replacements/dev/hde3 +/dev/hde4 <= Replacements/dev/hde4 +/dev/hde5 <= Replacements/dev/hde5 +/dev/hde6 <= Replacements/dev/hde6 +/dev/hde7 <= Replacements/dev/hde7 +/dev/hde8 <= Replacements/dev/hde8 +/dev/hde9 <= Replacements/dev/hde9 +/dev/hdf <= Replacements/dev/hdf +/dev/hdf1 <= Replacements/dev/hdf1 +/dev/hdf10 <= Replacements/dev/hdf10 +/dev/hdf11 <= Replacements/dev/hdf11 +/dev/hdf12 <= Replacements/dev/hdf12 +/dev/hdf13 <= Replacements/dev/hdf13 +/dev/hdf14 <= Replacements/dev/hdf14 +/dev/hdf15 <= Replacements/dev/hdf15 +/dev/hdf16 <= Replacements/dev/hdf16 +/dev/hdf17 <= Replacements/dev/hdf17 +/dev/hdf18 <= Replacements/dev/hdf18 +/dev/hdf19 <= Replacements/dev/hdf19 +/dev/hdf2 <= Replacements/dev/hdf2 +/dev/hdf20 <= Replacements/dev/hdf20 +/dev/hdf3 <= Replacements/dev/hdf3 +/dev/hdf4 <= Replacements/dev/hdf4 +/dev/hdf5 <= Replacements/dev/hdf5 +/dev/hdf6 <= Replacements/dev/hdf6 +/dev/hdf7 <= Replacements/dev/hdf7 +/dev/hdf8 <= Replacements/dev/hdf8 +/dev/hdf9 <= Replacements/dev/hdf9 +/dev/hdg <= Replacements/dev/hdg +/dev/hdg1 <= Replacements/dev/hdg1 +/dev/hdg10 <= Replacements/dev/hdg10 +/dev/hdg11 <= Replacements/dev/hdg11 +/dev/hdg12 <= Replacements/dev/hdg12 +/dev/hdg13 <= Replacements/dev/hdg13 +/dev/hdg14 <= Replacements/dev/hdg14 +/dev/hdg15 <= Replacements/dev/hdg15 +/dev/hdg16 <= Replacements/dev/hdg16 +/dev/hdg17 <= Replacements/dev/hdg17 +/dev/hdg18 <= Replacements/dev/hdg18 +/dev/hdg19 <= Replacements/dev/hdg19 +/dev/hdg2 <= Replacements/dev/hdg2 +/dev/hdg20 <= Replacements/dev/hdg20 +/dev/hdg3 <= Replacements/dev/hdg3 +/dev/hdg4 <= Replacements/dev/hdg4 +/dev/hdg5 <= Replacements/dev/hdg5 +/dev/hdg6 <= Replacements/dev/hdg6 +/dev/hdg7 <= Replacements/dev/hdg7 +/dev/hdg8 <= Replacements/dev/hdg8 +/dev/hdg9 <= Replacements/dev/hdg9 +/dev/hdh <= Replacements/dev/hdh +/dev/hdh1 <= Replacements/dev/hdh1 +/dev/hdh10 <= Replacements/dev/hdh10 +/dev/hdh11 <= Replacements/dev/hdh11 +/dev/hdh12 <= Replacements/dev/hdh12 +/dev/hdh13 <= Replacements/dev/hdh13 +/dev/hdh14 <= Replacements/dev/hdh14 +/dev/hdh15 <= Replacements/dev/hdh15 +/dev/hdh16 <= Replacements/dev/hdh16 +/dev/hdh17 <= Replacements/dev/hdh17 +/dev/hdh18 <= Replacements/dev/hdh18 +/dev/hdh19 <= Replacements/dev/hdh19 +/dev/hdh2 <= Replacements/dev/hdh2 +/dev/hdh20 <= Replacements/dev/hdh20 +/dev/hdh3 <= Replacements/dev/hdh3 +/dev/hdh4 <= Replacements/dev/hdh4 +/dev/hdh5 <= Replacements/dev/hdh5 +/dev/hdh6 <= Replacements/dev/hdh6 +/dev/hdh7 <= Replacements/dev/hdh7 +/dev/hdh8 <= Replacements/dev/hdh8 +/dev/hdh9 <= Replacements/dev/hdh9 +/dev/scd0 <= Replacements/dev/scd0 +/dev/scd1 <= Replacements/dev/scd1 +/dev/scd10 <= Replacements/dev/scd10 +/dev/scd11 <= Replacements/dev/scd11 +/dev/scd12 <= Replacements/dev/scd12 +/dev/scd13 <= Replacements/dev/scd13 +/dev/scd14 <= Replacements/dev/scd14 +/dev/scd15 <= Replacements/dev/scd15 +/dev/scd16 <= Replacements/dev/scd16 +/dev/scd2 <= Replacements/dev/scd2 +/dev/scd3 <= Replacements/dev/scd3 +/dev/scd4 <= Replacements/dev/scd4 +/dev/scd5 <= Replacements/dev/scd5 +/dev/scd6 <= Replacements/dev/scd6 +/dev/scd7 <= Replacements/dev/scd7 +/dev/scd8 <= Replacements/dev/scd8 +/dev/scd9 <= Replacements/dev/scd9 diff --git a/sys-apps/yard/files/yard-2.0/etc/Config.pl b/sys-apps/yard/files/yard-2.0/etc/Config.pl new file mode 100644 index 000000000000..5995b58f05cf --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Config.pl @@ -0,0 +1,175 @@ +# -*- Mode: Perl -*- +# +# $Id: Config.pl,v 1.1 2001/04/09 03:01:00 achim Exp $ +# CONFIG.PL - Configuration options for Yard. +# +# Tailor these for your system. +# These variables have to be in Perl syntax, which is simply: +# +# $var = value; +# or +# @array = (value1, value2, ..., valueN); +# +# +############################################################################## +package CFG; + +# $verbosity: 1 or 0 +# +# This controls only what is printed to the screen. +# 0 --> only the important messages. +# 1 --> all messages. +# All messages will be written to the log file regardless of the setting. +# +$verbosity = 0; + + +# $floppy: string (device name) +# $floppy_capacity: integer (kilobytes) +# +# The floppy device where the rescue disk will be written and its +# capacity. Make sure the two agree. If $floppy is a non-standard +# size (eg, 1722K), make sure to use the complete name (eg, /dev/fd0H1722). +# +$floppy = "/dev/fd0"; +$floppy_capacity = 1440; # KB + + +# $disk_set: string (one of "single", "double" or "base+extra") +# +# single: Both the kernel and entire compressed root filesystem will +# be put on one disk. +# +# double: The kernel will be put on the first disk and the compressed +# root fs will be put on the second. +# +# base+extra: THIS OPTION NOT YET IMPLEMENTED. The first disk will +# contain the kernel plus a base set of files (enough to boot and run +# tar). The second disk will contain the remaining files. +# +$disk_set = "double"; + + +# $mount_point: string (directory name) +# +# A directory to be used as a mount point. This is where the root +# filesystem will be mounted during creation and where the floppy +# will be mounted when the rescue disk is being written. +# This directory must exist when the Yard scripts are run. +# +$mount_point = "/mnt/floppy"; + + +# $device: string (device name) +# +# The device for building the filesystem. This can be /dev/ram0 or a +# spare partition. You can turn off swapping temporarily and use the +# swap partition on your hard disk. You can use a loopback device if +# your kernel supports them -- see the section "Using a Loopback +# Device" in the Yard documentation for instructions. +# It should not be a symbolic link. +# +$device = "/dev/rd/0"; + + +# $fs_size: integer (kilobytes) +# +# The size limit of $device, in Kbytes. For most devices, Yard can +# check this value against the available space. +# +$fs_size = 4096; # KB + + +# $kernel: string (filename) +# +# The absolute filename of the compressed kernel to be put on the +# rescue disk. This should be the COMPRESSED kernel. This is +# usually something like /vmlinuz, /zImage or /boot/zImage. If +# you've just remade your kernel (via "make zImage") the kernel file +# will reside in /usr/src/linux/arch/i386/boot/zImage +# +$kernel = "/boot/vmlinuz"; + +# $kernel_version: string (version string) +# +# make_root_fs will examine $kernel and try to determine its version. +# If Yard guesses incorrectly, or you want to force it anyway, set +# $kernel_version here. The value should be a version string such as +# that returned by "uname -r". +# +#$kernel_version = "2.2.15"; + + +# $contents_file: string (filename) +# +# The file specifying the bootdisk contents specification file. +# +$contents_file = "/etc/yard/Bootdisk_Contents"; + + +# $rootfsz: string (filename) +# The file that will temporarily hold the compressed root filesystem +# +$rootfsz = "/tmp/root.gz"; + + +# $oldroot: absolute directory name +# +# Where the old (hard disk) root filesystem will be mounted on the +# ramdisk filesystem. create_fstab uses this to adapt your +# /etc/fstab for use on the rescue disk so you'll be able to mount +# hard disk partitions more easily. You shouldn't need to change +# this, but run create_fstab.pl again if you do. +# +$oldroot = "/OLDROOT"; + + +# $strip_objfiles: 0 or 1 +# +# If set to 1, binary executables and libraries will be stripped +# of their debugging symbols (using objcopy) as they're copied to the +# root filesystem. This may reduce their size somewhat. If you don't +# understand what this means, leave it at 1. If you're sure you +# don't have objcopy, or for some reason you want debugging symbols, +# set it to 0. +# +$strip_objfiles = 1; + + +# $yard_temp: string (directory name) +# +# If non-null, specifies directory where .log and .ls files will be +# written. If null, log files will be written to current working +# directory. +# +$yard_temp = ""; + + +# $use_lilo: 1 or 0 +# +# Whether to use Lilo for transferring the kernel to the boot disk. +# 1 => Yard will use Lilo to boot the kernel. The configuration file is +# created when you invoke "make", and ends up +# in /etc/yard/Replacements/etc/lilo.conf. This option +# allows you to use Lilo's APPEND clause and various other Lilo +# options. +# +# 0 => Yard will copy the kernel directly to the rescue disk. +# +$use_lilo = 0; + + +# @additional_dirs: array of directory names +# +# Any additional directories (besides those in $PATH) to be searched +# for rescue disk files. Directories inside the list must be +# separated by commas. You don't need a trailing slash on these +# directory names. NB. Any directories you list here will be +# searched BEFORE those in $PATH. +# +@additional_dirs = ( "/etc/fs", + "/etc/rc.d" + ); + + +1;###################### End of Config.pl, put nothing below this line. diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/bootdisk_motd b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/bootdisk_motd new file mode 100644 index 000000000000..ba86c4e6cf03 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/bootdisk_motd @@ -0,0 +1 @@ +Welcome to GentooBoot rescue disk diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/fstab b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/fstab new file mode 100644 index 000000000000..454b7e833445 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/fstab @@ -0,0 +1,4 @@ +# DEVICE MOUNTPOINT TYPE OPTIONS DUMP FSCKORDER +#---------------------------------------------------------------- +/dev/ram0 / ext2 defaults +/proc /proc proc defaults diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/gettydefs b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/gettydefs new file mode 100644 index 000000000000..5c783db54132 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/gettydefs @@ -0,0 +1 @@ +VC# B9600 SANE CLOCAL # B9600 SANE -ISTRIP CLOCAL #Log_in_as_root: #VC diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab new file mode 100644 index 000000000000..7bc7cc8dae07 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab @@ -0,0 +1,17 @@ +# Default runlevel. +id:5:initdefault: + +# Run rc when system boots +si:S:sysinit:/etc/rc + +# NB. This uses getty, not agetty. + +c1:1235:respawn:/sbin/getty tty1 VC linux +c2:1235:respawn:/sbin/getty tty2 VC linux +c3:5:respawn:/sbin/getty tty3 VC linux +c4:5:respawn:/sbin/getty tty4 VC linux +c5:5:respawn:/sbin/getty tty5 VC linux +c6:45:respawn:/sbin/getty tty6 VC linux + +ca::ctrlaltdel:/sbin/shutdown -t5 -rfn now + diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab.agetty b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab.agetty new file mode 100644 index 000000000000..22b1dd780e49 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/inittab.agetty @@ -0,0 +1,21 @@ +# Default runlevel. +id:5:initdefault: + +# Run rc when system boots +si:S:sysinit:/etc/rc + +# NOTE: THIS IS FOR SLACKWARE AGETTY ONLY! Other versions of agetty +# use a different argument order that will cause agetty to +# hang. +# Check these calls against your own /etc/inittab ! +# Note: for 'agetty' you use linespeed, line. +# for 'getty_ps' you use line, linespeed and also use 'gettydefs' +c1:1235:respawn:/sbin/agetty 38400 tty1 linux +c2:1235:respawn:/sbin/agetty 38400 tty2 linux +c3:5:respawn:/sbin/agetty 38400 tty3 linux +c4:5:respawn:/sbin/agetty 38400 tty4 linux +c5:5:respawn:/sbin/agetty 38400 tty5 linux +c6:45:respawn:/sbin/agetty 38400 tty6 linux + +ca::ctrlaltdel:/sbin/shutdown -t5 -rfn now + diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/nsswitch.conf b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/nsswitch.conf new file mode 100644 index 000000000000..e4e4284ac997 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/nsswitch.conf @@ -0,0 +1,16 @@ +# Simple /etc/nsswitch.conf for a rescue disk +passwd: files +shadow: files +group: files +hosts: files +services: files +networks: files +protocols: files +rpc: files +ethers: files +netmasks: files +bootparams: files +automount: files +aliases: files +netgroup: files +publickey: files diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/pam.conf b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/pam.conf new file mode 100644 index 000000000000..ce85913c783d --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/pam.conf @@ -0,0 +1,8 @@ +# Simple pam.conf for rescue disk +# Be sure to include the libraries in the fourth column +# in Bootdisk_contents +OTHER auth optional /lib/security/pam_permit.so +OTHER auth optional /lib/security/pam_permit.so +OTHER account optional /lib/security/pam_permit.so +OTHER password optional /lib/security/pam_permit.so +OTHER session optional /lib/security/pam_permit.so diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/passwd b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/passwd new file mode 100644 index 000000000000..0ebed31f4260 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/passwd @@ -0,0 +1,4 @@ +root::0:0:root:/root:/bin/sh +halt:*:7:0:halt:/sbin:/sbin/halt +shutdown:*:6:0:shutdown:/sbin:/sbin/shutdown +sync:*:5:0:sync:/sbin:/bin/sync diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/profile b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/profile new file mode 100644 index 000000000000..669fbce8cf92 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/profile @@ -0,0 +1,2 @@ +export PATH=/bin:/sbin:/usr/bin:/usr/sbin + diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/rc b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/rc new file mode 100755 index 000000000000..7959d737e404 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/rc @@ -0,0 +1,23 @@ +#!/bin/sh +# +# /etc/rc: System initialization script. +# +# Remount ROOT rw + +/bin/mount -n -o remount,rw / + +# Compute module dependencies +#/sbin/depmod -a + +# Start up kerneld if desired +#/sbin/kerneld + +# Mount everything mentioned in fstab +/bin/mount -av + +# Set host name +/bin/hostname Rescue + +# If you need to load a keyboard map, uncomment this line and +# fix the pathnames: +#/usr/sbin/loadkeys /usr/lib/kbd/keytables/defkeymap.map diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/termcap b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/termcap new file mode 100644 index 000000000000..cc39a48d09ce --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/termcap @@ -0,0 +1,17 @@ +# a cut down version of /etc/termcap: terminal capability database. +# Just define linux console + +linux|console|con80x25|dumb:\ + :do=^J:co#80:li#25:cl=\E[H\E[J:sf=\ED:sb=\EM:\ + :le=^H:bs:am:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\ + :ce=\E[K:cd=\E[J:so=\E[7m:se=\E[27m:us=\E[4m:ue=\E[m:\ + :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:is=\E[1;25r\E[25;1H:\ + :ll=\E[1;25r\E[25;1H:al=\E[L:dc=\E[P:dl=\E[M:\ + :it#8:ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:kb=^H:ti=\E[r\E[H:\ + :ho=\E[H:kP=\E[5~:kN=\E[6~:kH=\E[4~:kh=\E[1~:kD=\E[3~:kI=\E[2~:\ + :k1=\E[[A:k2=\E[[B:k3=\E[[C:k4=\E[[D:k5=\E[[E:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k0=\E[21~:K1=\E[1~:K2=\E[5~:\ + :K4=\E[4~:K5=\E[6~:\ + :pt:sr=\EM:vt#3:xn:km:bl=^G:vi=\E[?25l:ve=\E[?25h:vs=\E[?25h:\ + :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:\ + :r1=\Ec:r2=\Ec:r3=\Ec: diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/ttytype b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/ttytype new file mode 100644 index 000000000000..e1dabac99079 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/etc/ttytype @@ -0,0 +1,6 @@ +console tty1 +console tty2 +console tty3 +console tty4 +console tty5 +console tty6 diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/pam.d/other b/sys-apps/yard/files/yard-2.0/etc/Replacements/pam.d/other new file mode 100644 index 000000000000..b9f907d0f761 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/pam.d/other @@ -0,0 +1,8 @@ +# Simple pam.conf for rescue disk +# Be sure to include the libraries in the fourth column +# in Bootdisk_contents +auth optional /lib/security/pam_permit.so +auth optional /lib/security/pam_permit.so +account optional /lib/security/pam_permit.so +password optional /lib/security/pam_permit.so +session optional /lib/security/pam_permit.so diff --git a/sys-apps/yard/files/yard-2.0/etc/Replacements/root/profile b/sys-apps/yard/files/yard-2.0/etc/Replacements/root/profile new file mode 100755 index 000000000000..5f5fb519a7b4 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/etc/Replacements/root/profile @@ -0,0 +1,18 @@ +# +# A basic .profile for root +# Provided by Horst von Brand +# +export HOSTNAME=Rescue +PATH=/bin:/usr/bin:/sbin:/usr/sbin:/OLDROOT/sbin:/OLDROOT/usr/sbin:/OLDROOT/bin:/OLDROOT/usr/bin:/OLDROOT/usr/local/sbin:/OLDROOT/usr/local/bin +if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then + TERM=linux +fi +PS1='\h:\w# ' +PS2='> ' +unset ignoreeof +umask 022 + +export PATH TERM PS1 PS2 + +LD_LIBRARY_PATH=/lib:/usr/lib:/OLDROOT/lib:/OLDROOT/usr/lib +export LD_LIBRARY_PATH diff --git a/sys-apps/yard/files/yard-2.0/sbin/check_root_fs b/sys-apps/yard/files/yard-2.0/sbin/check_root_fs new file mode 100644 index 000000000000..9cfc2b1923e7 --- /dev/null +++ b/sys-apps/yard/files/yard-2.0/sbin/check_root_fs @@ -0,0 +1,605 @@ +#! /usr/bin/perl +# -*- Mode: Perl -*- +# This script created automatically from scripts/check_root_fs.in +# $Header: /var/cvsroot/gentoo-x86/sys-apps/yard/files/yard-2.0/sbin/check_root_fs,v 1.1 2001/04/09 03:01:00 achim Exp $ +############################################################################## +## +## CHECK_ROOT_FS +## Copyright (C) 1996,1997,1998 Tom Fawcett (fawcett@croftj.net) +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## +## +############################################################################## +use strict; +use File::Basename; +use File::Path; +use FileHandle; +use English; +use lib "/etc/yard", "/usr/lib/yard"; +use yardconfig; +use File::Find; + +BEGIN { require "yard_utils.pl" } +require "Config.pl"; + +### GLOBAL VARIABLES +my(%Termcap); # Defs from /etc/termcap +my($checked_for_getty_files); # Scalar -- have we checked getty files yet? +my(%checked); # Hash table of files we've already checked +# This is a little crude. Technically we should read /etc/conf.getty +# to make sure we're not supposed to be using a different login binary. +my($login_binary) = "$CFG::mount_point/bin/login"; + + +STDOUT->autoflush(1); + +start_logging_output(); +info 0, "check_root_fs 2.0\n"; + +mount_device_if_necessary(); + +# This goes first so we define %Termcap for use in children +check_termcap(); + +##### Here are the tests. +fork_chroot_and(\&check_fstab); +fork_chroot_and(\&check_inittab); +fork_chroot_and(\&check_scripts); +check_links(); +check_passwd(); +check_pam(); +check_nss(); + +info 0, "All done.\n"; +info 0, "If this is acceptable, continue with write_rescue_disk\n"; +exit; + + +############################################################################## +sub warning { + info 0, "\n", @_; +# $::Warnings++; +} + + +# This takes a procedure call, forks off a subprocess, chroots to +# $CFG::mount_point and runs the procedure. +sub fork_chroot_and { + my($call) = @_; + + my($Godot) = fork; + die "Can't fork: $!" unless defined $Godot; + + if (!$Godot) { + # Child process + chdir($CFG::mount_point); + chroot($CFG::mount_point); ##### chroot to the root filesystem + &$call; + exit; + + } else { + # Parent here + waitpid($Godot, 0); + } +} + + +sub check_fstab { + my($FSTAB) = "/etc/fstab"; + my($proc_seen); + + open(FSTAB, "<$FSTAB") or error "$FSTAB: $!"; + info 0, "\nChecking $FSTAB\n"; + + while () { + chomp; + next if /^\#/ or /^\s*$/; + + my($dev, $mp, $type, $opts) = split; + next if $mp eq 'none' or $type eq 'swap'; + next if $dev eq 'none'; + + if (!-e $mp) { + info 0, "$FSTAB($.): $_\n\tCreating $mp on root filesystem\n"; + mkpath($mp); + } + + if ($dev !~ /:/ and !-e $dev) { + warning "$FSTAB($.): $_\n\tDevice $dev does not exist " + . "on root filesystem\n"; + } + + ##### If you use the file created by create_fstab, these tests + ##### are superfluous. + + if ($dev =~ m|^/dev/hd| and $opts !~ /noauto/) { + warning "\t($.): You probably should include \"noauto\" option\n", + "\tin the fstab entry of a hard disk. When the rescue floppy\n", + "\tboots, the \"mount -a\" will try to mount $dev\n"; + + } elsif ($dev eq $CFG::floppy and $type ne 'ext2' and $type ne 'auto') { + warning "\t($.): You've declared your floppy drive $CFG::floppy", + " to hold\n", + "\ta $type filesystem, which is not ext2. The rescue floppy\n", + "\tis ext2, which may confuse 'mount -a' during boot.\n"; + + } elsif ($type eq 'proc') { + $proc_seen = 1; + + } + } + close(FSTAB); + warning "\tNo /proc filesystem defined.\n" unless $proc_seen; + info 0, "Done with $FSTAB\n"; +} + + +sub check_inittab { + my($INITTAB) = "/etc/inittab"; + info 0, "\nChecking $INITTAB\n"; + + if (!open(INITTAB, "<$INITTAB")) { + warning "$INITTAB: $!\n"; + return + } + + my($default_rl, $saw_line_for_default_rl); + + while () { + chomp; + my($line) = $_; # Copy for errors + s/\#.*$//; # Delete comments + next if /^\s*$/; # Skip empty lines + + my($code, $runlevels, $action, $command) = split(':'); + + if ($action eq 'initdefault') { ##### The initdefault runlevel + $default_rl = $runlevels; + next; + } + if ($runlevels =~ /$default_rl/) { + $saw_line_for_default_rl = 1; + } + if ($command) { + my($exec, @args) = split(' ', $command); + + if (!-f $exec) { + warning "$INITTAB($.): $line\n", + "\t$exec: non-existent or non-executable\n"; + + } elsif (!-x $exec) { + info 0, "$INITTAB($.): $line\n", + info 0, "\tMaking $exec executable\n"; + chmod(0777, $exec) or error "chmod failed: $!"; + + } else { + ##### executable but not binary ==> script + scan_command_file($exec, @args) if !-B $exec; + } + + if ($exec =~ m|getty|) { # matches *getty* call + check_getty_type_call($exec, @args); + } + } + } + close(INITTAB) or error "close(INITTAB): $!"; + + if (!$saw_line_for_default_rl) { + warning "\tDefault runlevel is $default_rl, but no entry for it.\n"; + } + info 0, "Done with $INITTAB\n"; +} + + +##### This could be made much more complete, but for typical rc type +##### files it seems to catch the common problems. +sub scan_command_file { + my($cmdfile, @args) = @_; + my(%warned, $line); + + return if $checked{$cmdfile}; + info 0, "\nScanning $cmdfile\n"; + open(CMDFILE, "<$cmdfile") or error "$cmdfile: $!"; + + while ($line = ) { + chomp($line); + next if $line =~ /^\#/ or /^\s*$/; + + next if $line =~ /^\w+=/; + + while ($line =~ m!(/(usr|var|bin|sbin|etc|dev)/\S+)(\s|$)!g) { + my($abs_file) = $1; + # next if $abs_file =~ m/[*?]/; # Skip meta chars - we don't trust glob + next if $warned{$abs_file}; # Only warn once per file + if (!-e $abs_file) { + warning "$cmdfile($.): $line\n\t$1: missing on root filesystem\n"; + $warned{$abs_file} = 1; + } + } + } + close(CMDFILE) or error "close($cmdfile): $!"; + + $checked{$cmdfile} = 1; + info 0, "Done scanning $cmdfile\n"; +} + + +##### Check_passwd is NOT run under chroot. +sub check_passwd { + my($passwd_file) = "$CFG::mount_point/etc/passwd"; + open(PASSWD, "<$passwd_file") or error "Can't read passwd file: $!\n"; + info 0, "\nChecking passwd file $passwd_file\n"; + + while () { + chomp; + next if /^\s*$/; # Skip blank/empty lines + my($line) = $_; + my($login_name, $passwd, $UID, $GID, $user_name, $home, $shell) = + split(':'); + + next if $passwd eq "*"; # Skip warnings if user can't login + + -d ($CFG::mount_point . $home) or + warning "$passwd_file($.): $line\n", + "\tHome directory of $login_name ($CFG::mount_point$home) is missing\n"; + -e ($CFG::mount_point . $shell) or + warning "$passwd_file($.): $line\n", + "\tShell of $login_name ($CFG::mount_point$shell) doesn't exist\n"; + + check_init_files($login_name, $home, $shell); + } + close(PASSWD); + info 0, "Done checking $passwd_file\n"; +} + + +##### Simple PAM configuration checks. +##### Tests whether PAM is needed, and whether the configuration libraries exist. +##### Check_pam is NOT run under chroot. +sub check_pam { + my($pam_configured) = 0; # Have we seen some pam config file yet? + info 0, "Checking for PAM\n"; + + my($pamd_dir) = "$CFG::mount_point/etc/pam.d"; + my($pam_conf) = "$CFG::mount_point/etc/pam.conf"; + + if (-e $pam_conf) { + info 0, "Checking $pam_conf\n"; + $pam_configured = 1; + open(PAM, $pam_conf) or error "Can't open pam.conf: $!\n"; + while () { + chomp; + next if /^\#/ or /^\s*$/; # Skip comments and empty lines + my($file) = (split)[3]; # Get fourth field + if (!-e "$CFG::mount_point/$file") { + warning "$pam_conf($.): $_\n", + "\tLibrary $file does not exist on root fs\n"; + } + # That's all we check for now + } + close(PAM) or die "Closing PAM: $!"; + info 0, "Done with $pam_conf\n"; + } + + + if (-e $pamd_dir) { + info 0, "Checking files in $pamd_dir\n"; + opendir(PAMD, $pamd_dir) or error "Can't open $pamd_dir: $!"; + my($file); + while (defined($file = readdir(PAMD))) { + my($file2) = "$pamd_dir/$file"; + next unless -f $file2; # Skip directories, etc. + open(PF, $file2) or error "$file2: $!"; + while () { + chomp; + next if /^\#/ or /^\s*$/; # Skip comments and empty lines + my($file) = (split)[3]; # Get fourth field + $pam_configured = 1; + if (!-e "$CFG::mount_point/$file") { + warning "$file2($.): $_\n", + "\tLibrary $file does not exist on root fs\n"; + } + } + close(PF); + } + closedir(PAMD); + } + + # Finally, see whether PAM configuration is needed + if (!$pam_configured and -e $login_binary) { + my($dependencies) = scalar(`ldd $login_binary`); + if (defined($dependencies) and $dependencies =~ /libpam/) { + warning "Warning: login ($login_binary) needs PAM, but you haven't\n", + "\tconfigured it (in /etc/pam.conf or /etc/pam.d/)\n", + "\tYou probably won't be able to login.\n"; + } + } + info 0, "Done with PAM\n"; +} + + + +##### Basic checks for nsswitch.conf. +##### check_nss is NOT run under chroot. +##### From the nsswitch.conf(5) manpage: +##### For glibc, you must have a file called /lib/libnss_SERVICE.so.X for +##### every SERVICE you are using. On a standard installation, you could +##### use `files', `db', `nis' and `nisplus'. For hosts, you could specify +##### `dns' as extra service, for passwd, group and shadow `compat'. These +##### services will not be used by libc5 with NYS. The version number X +##### is 1 for glibc 2.0 and 2 for glibc 2.1. + +sub check_nss { + my($nss_conf) = "$CFG::mount_point/etc/nsswitch.conf"; + info 0, "Checking for NSS\n"; + + my($libc) = yard_glob("$CFG::mount_point/lib/libc-2*"); + my($libc_version) = $libc =~ m|/lib/libc-2.(\d)|; + if (!defined($libc_version)) { + warning "Can't determine your libc version\n"; + } else { + info 0, "You're using $libc\n"; + } + my($X) = $libc_version; + + if (-e $nss_conf) { + open(NSS, "<$nss_conf") or die "open($nss_conf): $!"; + + my($line); + while (defined($line = )) { + chomp $line; + next if $line =~ /^\#/; + next if $line =~ /^\s*$/; + my($db, $entries) = $line =~ m/^(\w+):\s*(.+)$/; + # Remove bracketed expressions (action specifiers) + $entries =~ s/\[[^\]]*\]//g; + my(@entries) = split(' ', $entries); + my($entry); + for $entry (@entries) { + next if $entry =~ /^\[/; # ignore action specifiers + my($lib) = "$CFG::mount_point/lib/libnss_${entry}.so.${X}"; + if (!-e $lib) { + warning "$nss_conf($.):\n$line\n", + "\tRoot filesystem needs $lib to support $entry\n"; + } + } + } + + } else { + # No nsswitch.conf is present, figure out if maybe there should be one. + if (-e $login_binary) { + my($dependencies) = scalar(`ldd $login_binary`); + my($libc_version) = ($dependencies =~ /libc\.so\.(\d+)/m); + if ($libc_version > 5) { + # Needs libc 6 or greater + warning "Warning: $login_binary on rescue disk needs libc.so.$libc_version,\n" + . "\tbut there is no NSS configuration file ($nss_conf)\n" + . "\ton root filesystem.\n"; + } + } + } + info 0, "Done with NSS\n"; +} + + + +sub check_links { + info 0, "\nChecking links relative to $CFG::mount_point\n"; + + sub wanted { + if (-l $File::Find::name) { + local($::raw_link) = readlink($File::Find::name); + local($::target) = make_link_absolute($File::Find::name, $::raw_link); + + # I added this next test for /dev/stdout link hair. + # This really should be more complicated to handle link chains, + # but as a hack this works for three. + if (onto_proc_filesystem($File::Find::name)) { + + } elsif (-l $::target) { + chase_link($::target, 16); + + } elsif (!-e $::target) { + warning "Warning: Unresolved link: $File::Find::name -> $::raw_link\n"; + } + } + }; + + finddepth(\&wanted, $CFG::mount_point); +} + + +sub chase_link { + my($file, $link_depth) = @_; + + if ($link_depth == 0) { + warning "Warning: Probable link circularity involving $file\n"; + + } elsif (-l $file) { + chase_link(make_link_absolute($file, readlink($file)), + $link_depth-1); + } +} + + +sub check_scripts { + info 0, "\nChecking script interpreters\n"; + local($::prog); + + sub check_interpreter { + if (-x $File::Find::name and -f _ and -T _) { + open(SCRIPT, $File::Find::name) or error "$File::Find::name: $!"; + my($prog, $firstline); + chomp($firstline =