Changeset 764 in MondoRescue for trunk/mindi/rootfs/sbin
- Timestamp:
- Aug 8, 2006, 12:34:37 AM (19 years ago)
- Location:
- trunk/mindi/rootfs/sbin
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/rootfs/sbin/LogIt
r30 r764 1 1 #!/bin/sh 2 # 3 # $Id$ 4 # 2 5 3 6 # if [ ! -e "/bin/date" ] ; then … … 8 11 currdate="" 9 12 10 LOGFILE=/tmp/mondo-restore.log 11 if [ ! -e "/tmp/mondo-restore.log" ] ; then 12 echo "...first line..." > /tmp/mondo-restore.log 13 fi 14 # mkdir -p /var/log 15 # ln -s -f /tmp/mondo-restore.log /var/log/mondo-restore.log 13 LOGFILE=/tmp/mondo-restore.log 14 if [ ! -e "$LOGFILE" ] ; then 15 echo "...first line..." > $LOGFILE 16 fi 16 17 17 18 # LogIt $phrase ------ log only -
trunk/mindi/rootfs/sbin/init
r649 r764 1 1 #!/bin/sh 2 2 # 3 # 04/20/2005 4 # - fix for 'skip the tape datadisks' bug (Joseph Smith) 3 # $Id$ 5 4 # 6 # 10/13/2004 7 # - echo 0 > /proc/sys/kernel/exec-shield to disable exec-shield 8 # 9 # 07/25 10 # - removed sbminst 11 # 12 # 06/25 13 # - klogd -c 2 (was -c 5) 14 # 15 # 06/21 16 # - experimented w/ calling ctrlaltdel to setup soft reset 17 # - don't softlink /var/log 18 # 19 # 06/16 20 # - insmod dm_mod as well as dm-mod 21 # 22 # 05/24 23 # - added Andree's vc.tgz 24 # 25 # 05/14 26 # - open => openvt (part of busybox) 27 # - nash removed. dm.tgz added 28 # 29 # 04/21 30 # - compare original lsmod output w/ new lsmod output 31 # 32 # 04/13 33 # - mount /sys if appropriate 34 # 35 # 04/03 36 # - use 'dd if=$tapedev bs=32k count=1024' instead of 'tar -zxf $tapedev' 37 # to extract aux datadisk files from tape 38 # 39 # 25/03 40 # - wait 7s, not 2s, while installing modules 41 # 42 # 18/01/2004 43 # - logging mondo-restore.cfg, not mondo-restore.log --- FIXED 44 # 45 # 11/23/2003 46 # - if find-and-mount-cdrom fails once, try again 47 # - open scrolling log of /tmp/mondo-restore.log later than previously 48 # 49 # 11/18 50 # - disabled clear()'s 51 # - reboot at end 52 # 53 # 11/15 54 # - softlink /var/log to /tmp/tmpfs/var/log 55 # - klogd -c 5 now (was -c 1) 56 # 57 # 11/10 58 # - don't call mondorestore if backup-media-type is not specified in 59 # config file /tmp/mondo-restore.cfg 60 # 61 # 10/21 62 # - softlink nano to pico if nano found 63 # 64 # 10/16 65 # - create /dev/md/* softlinks if necessary 66 # 67 # 10/12 68 # - start devfs if /tmp/USE-DEVFS found 69 # - create simple /etc/devfsd.conf file 70 # 71 # 10/09 72 # - try various mount commands to get tmpfs online (use initiative) 73 # 74 # 09/24 75 # - also try /dev/st0, /dev/osst0, /dev/ht0 if [tapedev] fails 76 # - modify media-dev in mondo-restore.cfg if we succeed :) 77 # 78 # 09/15 79 # - create /tmp/null and /tmp/stdout and /tmp/stderr 80 # as copies of the real thing, just in case partimagehack 81 # still uses them 82 # 83 # 08/01 84 # - tmpfs ramdisk is now 48m 85 # 86 # 07/14 87 # - added mkdirs at start 88 # 89 # 06/04 90 # - remount root as rw just in case 91 # 92 # 05/04 93 # - replaced /mnt/groovy-stuff with $GROOVY 94 # 95 # 04/30 96 # - if your CD was created by Mondoarchive when it backed up 97 # to ISO(s) then re-jig tmp/mondo-restore.cfg accordingly; 98 # this is nec. if you backup to a hard disk directory but 99 # then burn the ISOs to physical CDs 100 # 101 # 04/26 102 # - offer user the chance to specify another tape device, if 103 # the one they specified at backup-time refuses to act as 104 # aux data disk at boot-time 105 # 106 # 04/21 107 # - start scsi if cciss 108 # - use ataraid.tgz too 109 # 110 # 05/03 111 # - mount / -o rw,remount at end, just in case 112 # RH9 futzes with the mountpoint 113 # 114 # 04/04 115 # - increased tmpfs ramdisk size from 34m to 38m 116 # 117 # 01/01 - 01/31/2003 118 # - fixed issue with LVM and SW Raid devices (Brian Borgeson) 119 # - friendlier 'upgrade your ram' msg 120 # - better fallback msg 121 # - if /tmp/2880.siz exists then assume boot CD 122 # 123 # 11/01 - 12/31/2002 124 # - updated intro msg 125 # - if /dev/boot_device and /BOOTLOADER.DEVICE exist then 126 # copy device /dev/boot_device to pathname contained 127 # in /BOOTLOADER.DEVICE text file 128 # 129 # 04/01 - 08/31/2002 130 # - handle new 'backup_media_type' entry in mondo-restore.cfg 131 # - added 'sleep 2' at start of WelcomeMessage 132 # - disabled a silly 'abort' line at end 133 # - better handling of devfs (DuckX) --- new RunDevfsd() 134 # - assume start-nfs is in /sbin 135 # - extract rd.tgz, raw.tgz, ida.tgz, cciss.tgz to /; they include 136 # /dev entries which would otherwise fill up the ramdisk at bkp-time 137 # 138 # 01/01 - 03/31/2002 139 # - Carl Wilhelm Soderstrom disabled exec sh; replaced with exit 1 140 # - if you are an idiot & your computer has very little RAM, 141 # this script will no longer abort; it will merely warn you 142 # - run chmod 755 `which start-nfs` before running start-nfs 143 # - use a ramdisk for /tmp (after copying old /tmp stuff into it) 144 # - fixed segfaults ('open') by replacing 'sh' call with '/bin/sh' call 145 # - changed LaunchTerminals() to try to work with newly-compiled 'open' 146 # - don't write 'start-nfs error' if start-nfs doesn't exist; just go on 147 # - added tmpfs and some space-checking 148 # - cleaned up script 149 # - added stuff to start NFS services if necessary 150 # - reordered some of the main() stuff, for elegance's sake 151 # - added Petris and 'tail -f /tmp/mondo-restore.log' to LaunchTerminals() 152 # - changed /usr/share/ to /usr/local/ 153 # 154 # 2001 155 # - fix some typos 156 # - added lots of cool stuff to make Mindi _nearly_ boot from tape 157 # - restructured the welcome msg echoed to screen 158 # - broke up spaghetti code; made lots of subroutines 159 # 5 # init script launched during the restore process 160 6 #------------------------------------------------------------ 161 7 … … 232 78 openvt 6 /bin/sh 233 79 openvt 7 /bin/sh /sbin/wait-for-petris 234 # openvt 8 /usr/bin/tail -f /tmp/mondo-restore.log235 80 } 236 81 … … 385 230 LogIt "Devfs found. Testing kernel support..." 386 231 if [ ! -e "/dev/.devfsd" ] ; then 387 mount -t devfs devfs /dev 2>> /tmp/mondo-restore.log232 mount -t devfs devfs /dev 2>> $LOGFILE 388 233 if [ "$?" -ne "0" ] ; then 389 234 LogIt "Error while trying to mount devfs" … … 441 286 if [ -e "/tmp/i-want-my-lvm" ] ; then 442 287 LogIt "Scanning LVM's..." 1 443 if which lvm ; then444 MyInsmod dm-mod445 MyInsmod dm_mod446 lvm vgscan --mknodes447 else448 vgscan449 fi450 grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed s/#//> /tmp/start-lvm288 if which lvm ; then 289 MyInsmod dm-mod 290 MyInsmod dm_mod 291 lvm vgscan --mknodes 292 else 293 vgscan 294 fi 295 grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm 451 296 chmod +x /tmp/start-lvm 452 297 echo -en "Starting LVM's..." … … 461 306 # pipe vgscan's output, strip it, run 'vgchange' on its output, etc.etc. 462 307 LogIt "LVM's have been started." 463 }464 465 466 467 StartNfs() {468 # using mount -o nolock avoids portmap requirement469 #if which portmap > /dev/null 2> /dev/null ; then470 #LogIt "Running portmap"471 #portmap472 #[ "$?" -eq "0" ] && LogIt "Portmap started OK" || LogIt "Portmap error"473 if [ -e "/sbin/start-nfs" ] ; then474 chmod 755 /sbin/start-nfs475 LogIt "Starting NFS..."476 /sbin/start-nfs477 fi478 #fi479 308 } 480 309 … … 539 368 mount_cmd="mount /dev/shm -t tmpfs -o size=$size" ; # was 34m until 04/2003 540 369 LogIt "Trying '$mount_cmd'" 541 $mount_cmd /tmp/tmpfs 2>> / tmp/mondo-restore.log370 $mount_cmd /tmp/tmpfs 2>> /$LOGFILE 542 371 res=$? 543 372 [ "$res" -eq "0" ] && break … … 635 464 fi 636 465 637 #if [ -e "/tmp/2880.siz" ] ; then638 # HandleCDROMorFloppies639 #el640 466 if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then 641 467 HandleTape 642 468 ExtractDataDisksAndLoadModules 643 elif [ -e "/sbin/start-nfs" ] && [ "`grep -i pxe /proc/cmdline`" ]; then 644 StartNfs 645 imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-` 646 if [ "$imgname" = "" ]; then 647 imgname="mondorescue" 648 fi 649 if [ "`grep -i prefix /proc/cmdline`" ] ; then 650 for i in `cat /proc/cmdline` ; do 651 if [ "`echo $i | grep -i prefix`" ] ; then 652 imgname=`echo $i | cut -d'=' -f2` 653 fi 654 done 655 fi 656 dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-` 657 if [ "$dirimg" = "" ]; then 658 dirimg="/" 659 fi 660 LogIt "Mounting NFS image $imgname-1.iso in $dirimg on /mnt/cdrom in loopback" 661 losetup /dev/loop7 /tmp/isodir/$dirimg/$imgname-1.iso 662 mount -o ro -t iso9660 /dev/loop7 /mnt/cdrom 469 elif [ "`grep -i pxe /proc/cmdline`" ]; then 470 /sbin/start-nfs 471 663 472 # Simulate a local CD 664 473 echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE 665 474 CD_MOUNTED_OK=yes 666 475 ExtractDataDisksAndLoadModules 667 476 else 668 477 HandleCDROMorFloppies 669 478 ExtractDataDisksAndLoadModules 670 if [ -e "/sbin/start-nfs" ]; then 671 StartNfs 672 fi 479 /sbin/start-nfs 673 480 fi 674 481 res=$? … … 710 517 fi 711 518 hack-cfg-if-necessary || LogIt "Cannot find hack-cfg-if-necessary" 712 openvt 8 /usr/bin/tail -f /tmp/mondo-restore.log519 openvt 8 /usr/bin/tail -f $LOGFILE 713 520 714 521 #------------------------------- -
trunk/mindi/rootfs/sbin/post-init
r274 r764 72 72 else 73 73 if [ "$iso$nuke$compare$interactive" != "" ] ; then 74 LogIt "FYI, this CD was made by Mindi, not Mondo." 1 75 exit 0 76 74 LogIt "FYI, this CD was made by Mindi, not Mondo." 1 75 exit 0 77 76 else 78 LogIt "Mindi-Linux has finished booting."77 LogIt "Mindi-Linux has finished booting." 79 78 fi 80 79 fi
Note:
See TracChangeset
for help on using the changeset viewer.