Changeset 1842 in MondoRescue for branches/stable/mindi/rootfs
- Timestamp:
- Dec 15, 2007, 2:24:34 AM (16 years ago)
- Location:
- branches/stable/mindi/rootfs
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/rootfs/etc/udev-links.conf
r1770 r1842 50 50 M tty7 c 4 7 51 51 M tty8 c 4 8 52 M ttyS0 c 4 64 53 M ttyS1 c 4 65 52 54 L console /dev/tty0 53 55 L tty /dev/tty0 -
branches/stable/mindi/rootfs/sbin/find-and-mount-cdrom
r1770 r1842 41 41 fi 42 42 LogIt "CD-ROM found at $device" 43 mount /mnt/cdrom43 mount /mnt/cdrom 44 44 if [ "$?" -ne "0" ] ; then 45 45 LogIt "Cannot mount /dev/cdrom (type $format) (dev=$device)" -
branches/stable/mindi/rootfs/sbin/init
r1770 r1842 78 78 openvt 6 /bin/sh 79 79 openvt 7 /bin/sh /sbin/wait-for-petris 80 openvt 8 /usr/bin/tail -f $LOGFILE 80 81 } 81 82 … … 155 156 156 157 HHandleCDROM() { 158 # Just in case we have an iLO ensure we will map it correctly 159 echo "$DENY_MODS" | grep -q "usb-storage " 160 if [ $? -eq 0 ]; then 161 return 162 fi 163 echo "Activating a potential USB Storage device" 164 if [ -f usb-storage.ko ] || [ -f usb-storage.ko.gz ]; then 165 if [ -e "/tmp/USE-UDEV" ] ; then 166 modprobe -q usb-storage 167 else 168 insmod usb-storage.ko* 169 fi 170 fi 171 for i in 1 2 3 4 5 6 7 8 9 10 ; do 172 sleep 1 173 echo -en "." 174 done 175 157 176 find-and-mount-cdrom 158 177 res=$? … … 171 190 CD_MOUNTED_OK="" 172 191 else 173 LogIt "OK, I am unable to go on. You seem to be missing a driver" 3 174 LogIt "Your archives are probably fine but" 3 175 LogIt "your tape streamer and/or CD-ROM drive are eccentric. :-)" 3 192 LogIt "OK, I am falling back to floppy mode." 3 193 LogIt "(You may not have the right drivers" 3 194 LogIt "to support the hardware on which we are running)" 3 195 LogIt "That means you'll have to copy the data disk images from" 3 196 LogIt "the CD/hard disk/whatever to physical 1.44MB disks and" 3 197 LogIt "insert them, one after the other. Please see the manual." 3 198 LogIt "The images are in /images on the CD, or /root/images/mindi" 3 199 LogIt "on your hard disk. Your archives are probably fine but" 3 200 LogIt "your tape streamer and/or CD-ROM drive are eccentric. :-)" 3 176 201 CD_MOUNTED_OK="" 177 202 fi … … 189 214 # Load the VIA IDE module first thing if it exists (requires ide-core). 190 215 # This is to ensure that DMA is working for VIA chipsets with 2.6 kernels. 191 for module in /ide-core.ko /via82cxxx.ko; do216 for module in /ide-core.ko* /via82cxxx.ko*; do 192 217 [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null 193 218 done … … 264 289 } 265 290 291 create_dev_makedev() { 292 if [ -e /sbin/MAKEDEV ]; then 293 ln -sf /sbin/MAKEDEV /dev/MAKEDEV 294 else 295 ln -sf /bin/true /dev/MAKEDEV 296 fi 297 } 266 298 267 299 RunUdevd() { … … 274 306 mount -n -t devpts -o mode=620 none /dev/pts 275 307 mount -n -t tmpfs none /dev/shm 308 if [ -e /proc/sys/kernel/hotplug ]; then 309 echo > /proc/sys/kernel/hotplug 310 fi 276 311 PKLVL=`cut -f1 /proc/sys/kernel/printk` 277 312 echo 0 > /proc/sys/kernel/printk … … 282 317 /sbin/udevd --daemon & 283 318 sleep 2 284 echo $PKLVL > /proc/sys/kernel/printk 319 mkdir -p /dev/.udev/queue/ 320 if [ -x /sbin/udevtrigger ]; then 321 /sbin/udevtrigger 322 fi 323 create_dev_makedev 285 324 # May avoid shell error messages 286 325 chmod 644 /dev/tty* 326 if [ -x /sbin/udevsettle ]; then 327 /sbin/udevsettle 328 fi 329 # It seems we need to have more static devs on some distro were 330 # udev as some other requirements to be covered later on. 331 # So in the mean time: 332 for d in `ls /dev.static`; do 333 if [ ! -e /dev/$d ]; then 334 mv /dev.static/$d /dev 335 fi 336 done 337 echo $PKLVL > /proc/sys/kernel/printk 287 338 } 288 339 … … 292 343 answer="NO" 293 344 345 grep -q nohw /proc/cmdline 346 if [ "$?" -eq 0 ]; then 347 return 348 fi 294 349 if [ -x ./mindi-rsthw ]; then 295 350 grep -q RESTORE /proc/cmdline 296 351 if [ "$?" -ne 0 ]; then 297 clear352 #clear 298 353 echo "*********************************************************************" 299 354 echo "Do you want to restore the HW configuration of the original machine ?" … … 333 388 fi 334 389 rm -f /tmp/FLF 390 } 391 392 StartUSBKbd() { 393 # Prepare minimal USB env in case we have USB kbd such as with iLO 394 [ -d /proc/bus/usb ] && ! grep -q /proc/bus/usb /proc/mounts && mount -t usbfs none /proc/bus/usb 395 echo "$DENY_MODS" | grep -Eq 'uhcd_hci |usbhid |usbcore ' 396 if [ $? -eq 0 ]; then 397 return 398 fi 399 if [ -e "/tmp/USE-UDEV" ] ; then 400 if [ -f uhcd_hci.ko ] || [ -f uhcd_hci.ko.gz ]; then 401 modprobe -q uhcd_hci 402 fi 403 if [ -f usbhid.ko ] || [ -f usbhid.ko.gz ]; then 404 modprobe -q usbhid 405 fi 406 else 407 if [ -f uhcd_hci.ko ]; then 408 insmod uhcd_hci.ko 409 fi 410 if [ -f usbhid.ko ]; then 411 insmod usbcore.ko 412 insmod usbhid.ko 413 fi 414 fi 335 415 } 336 416 … … 468 548 WelcomeMessage() 469 549 { 550 export ARCH=`uname -m` 551 470 552 echo "********************************************************************" 471 553 echo "MINDI-LINUX by Mondo Dev Team - web site: http://www.mondorescue.org" … … 490 572 } 491 573 574 ModprobeAllModules() { 575 576 for m in `find /lib/modules -name '*.ko*'`; do 577 j=`basename $m | sed 's/\.ko.*$//'` 578 echo "$DENY_MODS" | grep -q "$j " 579 if [ $? -eq 0 ]; then 580 echo "Denying $j..." 581 continue 582 fi 583 echo "Probing $j..." 584 modprobe -q $j 585 done 586 } 492 587 493 588 ExtractDataDisksAndLoadModules() { 494 589 echo "Installing additional tools ..." 495 590 install-additional-tools 496 echo "Inserting modules ..."497 591 # Keep the kernel silent again 498 592 PKLVL=`cut -f1 /proc/sys/kernel/printk` 499 593 echo 0 > /proc/sys/kernel/printk 500 insert-all-my-modules >> $LOGFILE 2>> $LOGFILE 594 if [ ! -e "/tmp/USE-UDEV" ] ; then 595 echo "Inserting modules ..." 596 insert-all-my-modules >> $LOGFILE 2>> $LOGFILE 597 for i in $FORCE_MODS; do 598 MyInsmod $i 599 done 600 else 601 ModprobeAllModules 602 fi 501 603 echo $PKLVL > /proc/sys/kernel/printk 502 604 } … … 524 626 mkdir /sys 2> /dev/null 525 627 mount /sys/ /sys -v -t sysfs 2>> $LOGFILE 628 # For ESX 3 629 [ -d /proc/vmware ] && ! grep -q /vmfs /proc/mounts && mount -t vmfs /vmfs /vmfs 526 630 rm -f /foozero 631 632 if [ "`grep -i denymods /proc/cmdline`" ]; then 633 export DENY_MODS="`cat /proc/cmdline | sed 's~.*denymods=\"\(.*\)\".*~\1~'` mondonone" 634 else 635 export DENY_MODS=" " 636 fi 637 638 if [ "`grep -i forcemods /proc/cmdline`" ]; then 639 export FORCE_MODS="`cat /proc/cmdline | sed 's~.*forcemods=\"\(.*\)\".*~\1~'` mondonone" 640 else 641 export FORCE_MODS=" " 642 fi 643 644 echo "Activating a potential USB keyboard/mouse" 645 StartUSBKbd 527 646 528 647 if [ -f /proc/sys/kernel/exec-shield ]; then … … 536 655 if [ -e "/tmp/USE-UDEV" ] ; then 537 656 RunUdevd 538 else 539 ExtractDevTarballs 540 fi 657 fi 658 ExtractDevTarballs 541 659 LaunchTerminals 542 660 … … 544 662 PKLVL=`cut -f1 /proc/sys/kernel/printk` 545 663 echo 0 > /proc/sys/kernel/printk 546 InsertEssentialModules 664 if [ ! -e "/tmp/USE-UDEV" ] ; then 665 InsertEssentialModules 666 else 667 ModprobeAllModules 668 fi 547 669 echo $PKLVL > /proc/sys/kernel/printk 548 670 549 671 EnableCcissIfAppropriate 550 RstHW551 672 #------------------------------- 552 673 #WHOLIVESINAPINEAPPLEUNDERTHESEA#;# --- don't touch this :) … … 590 711 RunDevfsd 591 712 fi 713 LoadKeymap 714 WelcomeMessage 715 RstHW 592 716 echo "Starting potential Raid/LVMs ..." 593 717 PauseForRaids … … 595 719 StartLvms 596 720 CopyBootDevEntry 597 LoadKeymap598 721 mkdir -p /tmp/tmpfs 599 722 sleep 2 … … 606 729 cp -af /dev/md2 /dev/md/2 2> /dev/null 607 730 fi 608 export ARCH=`uname -m`609 WelcomeMessage610 731 # SpaceTests; # Mandrake Linux 8.1 doesn't like this 611 732 [ -e "/tmp/mountlist.txt" ] && cp -f /tmp/mountlist.txt /tmp/mountlist.original … … 619 740 fi 620 741 hack-cfg-if-necessary || LogIt "Cannot find hack-cfg-if-necessary" 621 openvt 8 /usr/bin/tail -f $LOGFILE622 742 623 743 # Log some useful info 624 LogIt "init (from mindi v$MINDI_VER-r${MINDI_REV} "744 LogIt "init (from mindi v$MINDI_VER-r${MINDI_REV})" 625 745 LogIt "/proc/cmdline is:" 626 746 cat /proc/cmdline >> $LOGFILE -
branches/stable/mindi/rootfs/sbin/install-additional-tools
r1770 r1842 78 78 cd $mountdir 79 79 if [ -f etc/fstab ]; then 80 mvetc/fstab /tmp80 cp etc/fstab /tmp 81 81 fi 82 82 if [ -f etc/raidtab ]; then 83 mvetc/raidtab /tmp83 cp etc/raidtab /tmp 84 84 fi 85 85 -
branches/stable/mindi/rootfs/sbin/start-nfs
r1770 r1842 35 35 done 36 36 37 if [ "$ipdev" = "" ] && [ "$ipconf" = "" ]; then 38 # No network configuration neither stored during archive 39 # nor on cmdline so no network wanted => exiting 40 exit 0 41 else 37 if [ "$ipdev" != "" ] || [ "$ipconf" != "" ]; then 38 # Network configuration stored during archive 39 # or on cmdline so network wanted => starting it 42 40 LogIt "Starting Network..." 41 42 # Activate loobback 43 ifconfig lo 127.0.0.1 44 45 echo "$ipconf" | grep -q "dhcp" 46 if [ $? -eq 0 ]; then 47 ipdev=`echo $ipconf | cut -d: -f1` 48 LogIt "Making DHCP request on $ipdev" 49 udhcpc -i $ipdev 50 else 51 if [ "$ipconf" != "" ]; then 52 ipdev=`echo $ipconf | cut -d: -f1` 53 ipaddress=`echo $ipconf | cut -d: -f2` 54 ipnetmask=`echo $ipconf | cut -d: -f3` 55 ipbroadcast=`echo $ipconf | cut -d: -f4` 56 ipgateway=`echo $ipconf | cut -d: -f5` 57 fi 58 LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)" 59 ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast 60 route add default gw $ipgateway 61 fi 62 63 # ping server helps waking interface up 64 LogIt "Pinging NFS server..." 65 nfs_server_ipaddr=`echo $nfsmount | cut -d: -f1` 66 ping -c $ipcount $nfs_server_ipaddr 67 68 # Finally mounts the NFS share 69 LogIt "Mounting NFS share ($nfsmount) on /tmp/isodir..." 70 mount -t nfs -o nolock $nfsmount /tmp/isodir 71 72 LogIt "Mounting NFS image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback" 73 mount -o ro -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom 43 74 fi 44 45 # Activate loobback46 ifconfig lo 127.0.0.147 48 echo "$ipconf" | grep -q "dhcp"49 if [ $? -eq 0 ]; then50 ipdev=`echo $ipconf | cut -d: -f1`51 LogIt "Making DHCP request on $ipdev"52 udhcpc -i $ipdev53 else54 if [ "$ipconf" != "" ]; then55 ipdev=`echo $ipconf | cut -d: -f1`56 ipaddress=`echo $ipconf | cut -d: -f2`57 ipnetmask=`echo $ipconf | cut -d: -f3`58 ipbroadcast=`echo $ipconf | cut -d: -f4`59 ipgateway=`echo $ipconf | cut -d: -f5`60 fi61 LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)"62 ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast63 route add default gw $ipgateway64 fi65 66 # ping server helps waking interface up67 LogIt "Pinging NFS server..."68 nfs_server_ipaddr=`echo $nfsmount | cut -d: -f1`69 ping -c $ipcount $nfs_server_ipaddr70 71 # Finally mounts the NFS share72 LogIt "Mounting NFS share ($nfsmount) on /tmp/isodir..."73 mount -t nfs -o nolock $nfsmount /tmp/isodir74 75 LogIt "Mounting NFS image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback"76 mount -o ro -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom -
branches/stable/mindi/rootfs/sbin/start-usb
r1770 r1842 20 20 fi 21 21 22 [ -d /proc/bus/usb ] && ! grep -q /proc/bus/usb /proc/mounts && mount -t usbfs none /proc/bus/usb23 24 22 echo -en "Mounting USB device (${usbdev}1) on /mnt/cdrom..." 25 23 /sbin/modprobe usb-storage
Note:
See TracChangeset
for help on using the changeset viewer.