Changeset 3319 in MondoRescue for branches/3.0/mindi/mindi
- Timestamp:
- Dec 1, 2014, 11:35:39 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mindi/mindi
r3260 r3319 373 373 local r res mapfile mappath included_item included_list keyfile mp locale 374 374 LogAll "INFO: Analyzing your keyboard's configuration." 375 KEYDIR=/ lib/kbd375 KEYDIR=/usr/lib/kbd 376 376 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd # Slackware 377 377 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/lib/kbd 378 [ ! -e "$KEYDIR" ] && KEYDIR=/lib/kbd379 378 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share 380 379 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole 381 380 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup 381 [ ! -e "$KEYDIR" ] && KEYDIR=/lib/kbd 382 382 if [ ! -e "$KEYDIR" ] ; then 383 383 LogAll "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time." … … 387 387 LogFile "INFO: Red Hat-style config detected." 388 388 keyfile=/etc/sysconfig/keyboard 389 elif [ -e "/etc/vconsole.conf" ] ; then 390 LogFile "INFO: New Fedora style config detected." 391 keyfile=/etc/vconsole.conf 389 392 elif [ -e "/etc/rc.d/rc.keymap" ] ; then 390 393 LogFile "INFO: Slackware-style config detected." … … 445 448 locale=`grep -F KEYTABLE "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2 | sed 's/.map.gz$//'` 446 449 [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'` # Slackware 447 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2` # Gentoo & ArchLinux450 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2` # Gentoo, ArchLinux & New fedora 448 451 [ ! "$locale" ] && locale=`grep -E 'XkbLayout' "$keyfile" | grep -v '^#' | awk '{print $3}' | tr -d '"'` # Fedora 19 449 452 LogFile "INFO: locale=$locale" … … 487 490 FindLdlinux32Binary() { 488 491 LDLINUXC32=/usr/lib/syslinux/ldlinux.c32 489 [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib/syslinux/ldlinux.c32490 492 [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib64/syslinux/ldlinux.c32 491 493 [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/syslinux/ldlinux.c32 492 494 [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/lib/syslinux/ldlinux.c32 493 495 [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/lib64/syslinux/ldlinux.c32 496 [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib/syslinux/modules/bios/ldlinux.c32 497 [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib64/syslinux/modules/bios/ldlinux.c32 494 498 #[ ! -e "$LDLINUXC32" ] && LDLINUXC32=`find / -name ldlinux.c32 | grep -x "/.*/ldlinux.c32"` 495 499 if [ ! -e "$LDLINUXC32" ]; then … … 504 508 FindMboot32Binary() { 505 509 MBOOTC32=/usr/lib/syslinux/mboot.c32 506 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib/syslinux/mboot.c32507 510 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib64/syslinux/mboot.c32 508 511 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/syslinux/mboot.c32 509 512 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib/syslinux/mboot.c32 510 513 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib64/syslinux/mboot.c32 514 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib/syslinux/modules/bios/mboot.c32 515 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib64/syslinux/modules/bios/mboot.c32 511 516 [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"` 512 517 [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" … … 521 526 [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib/syslinux/isolinux.bin 522 527 [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib64/syslinux/isolinux.bin 528 [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/lib/ISOLINUX/isolinux.bin 523 529 [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"` 524 530 [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" … … 729 735 local lcMagicExt2fs="EXT2-fs: blocksize too small for device." 730 736 local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device." 731 local lcMagicInitfs="<6>checking if image is initramfs...|[<] 6[>]Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs"737 local lcMagicInitfs="<6>checking if image is initramfs...|[<]*6[>]*Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs" 732 738 733 739 # local variables … … 1760 1766 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 1761 1767 echo -en "Press <enter> to continue.\n" 1768 echo -en "$BOOT_MEDIA_MESSAGE" 1762 1769 elif [ ! "$MINDI_TMP" ] ; then 1763 1770 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" … … 2385 2392 if [ "$?" -eq "0" ] ; then 2386 2393 # Used by ia64 2387 fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`2394 fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"` 2388 2395 else 2389 fkern_ver=`strings $fname 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`2396 fkern_ver=`strings $fname 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"` 2390 2397 fi 2391 2398 echo "$fkern_ver" … … 2586 2593 # Copy of files mandatory for ssh to automate mount if sshfs is used 2587 2594 mkdir $mountpoint/.ssh 2588 cp - rp~root/.ssh/* $mountpoint/.ssh 2> /dev/null2589 echo> $mountpoint/tmp/myssh << EOF2595 cp -a ~root/.ssh/* $mountpoint/.ssh 2> /dev/null 2596 cat > $mountpoint/tmp/myssh << EOF 2590 2597 ssh -o StrictHostKeyChecking=no $* 2591 2598 EOF … … 2593 2600 2594 2601 # Copy of files mandatory for ld.so 2595 cp - rp/etc/ld.so.c* $mountpoint/etc2602 cp -a /etc/ld.so.c* $mountpoint/etc 2596 2603 2597 2604 # Handle the case where busybox and mount are dynamically linked … … 2602 2609 fi 2603 2610 2604 # Copy of files from the minimal env needed as per the deplist.d/minimal.conf file (which includes all busybox deps)2611 # Copy of files from the minimal env needed as per the deplist.d/minimal.conf & udev.conf file (which includes all busybox deps) 2605 2612 rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis 2606 for f in `grep -v " *#.*" $DEPLIST_DIR/minimal.conf | sort -u`; do 2607 if [ -r $f ]; then 2608 echo $f >> $MINDI_TMP/minimal.lis 2609 LocateDeps $f >> $MINDI_TMP/minimal2.lis 2613 for f in `cat $DEPLIST_DIR/minimal.conf $DEPLIST_DIR/udev.conf | grep -vE " *#.*|^#" | sort -u` ; do 2614 if [ -d $f ]; then 2615 for g in `find $f`; do 2616 echo $g >> $MINDI_TMP/minimal.lis 2617 LocateDeps $g >> $MINDI_TMP/minimal2.lis 2618 done 2619 else 2620 if [ -r $f ]; then 2621 echo $f >> $MINDI_TMP/minimal.lis 2622 LocateDeps $f >> $MINDI_TMP/minimal2.lis 2623 fi 2610 2624 fi 2611 2625 done … … 2640 2654 LogIt "INFO: udev device manager found" 2641 2655 tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /etc/udev analysis" $MINDI_TMP/$$.log 2642 # This avoids NIC remapping if on another machine at restore time on Debian at least 2643 rm -f ./etc/udev/rules.d/z[0-9][0-9]_persistent-net.rules 2644 # This avoids NIC remapping if on another machine at restore time on Ubuntu at least 2645 rm -f ./etc/udev/rules.d/[0-9][0-9]-persistent-net.rules 2656 # This avoids NIC remapping if on another machine at restore time on Debian/Ubuntu at least 2657 rm -f ./etc/udev/rules.d/[z]*[0-9][0-9][-_]persistent-net.rules 2646 2658 # Do not do it if it's a link (Ubuntu 64 bits #503) 2647 if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ 2659 if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ ! -h "/lib64/udev" ]; then 2648 2660 tar cf - -C / /lib64/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /lib64/udev analysis" $MINDI_TMP/$$.log 2649 2661 fi … … 2653 2665 if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [ ! -h "/lib/udev" ]; then 2654 2666 tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /lib/udev analysis" $MINDI_TMP/$$.log 2667 fi 2668 if [ -e "/usr/lib/udev" ] && [ ! -h "/usr/lib" ] && [ ! -h "/usr/lib/udev" ]; then 2669 tar cf - -C / /usr/lib/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /usr/lib/udev analysis" $MINDI_TMP/$$.log 2655 2670 fi 2656 2671 if [ -x /sbin/udevd ] || [ -x /usr/bin/udevd ] || [ -x /usr/lib/systemd/systemd-udevd ]; then … … 2664 2679 while [ -h $j ]; do 2665 2680 lis="$lis $j" 2666 j=`readlink $j`2681 j=`readlink -f $j` 2667 2682 done 2668 2683 lis="$lis $j" … … 2678 2693 [ "$j" != "" ] && rm -f $j 2679 2694 fi 2695 echo "$i" >> $MINDI_TMP/udev.lis 2680 2696 done 2681 2697 tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in udev.lis analysis" $MINDI_TMP/$$.log … … 2776 2792 # Copy FW in case some drivers needs it 2777 2793 for d in "/lib" "/usr/lib"; do 2778 if [ -d "$d/firmware" ]; then2794 if [ -d "$d/firmware" -a ! -h $d ]; then 2779 2795 cp -a "$d/firmware" "$mountpoint/$d" 2780 2796 fi … … 2783 2799 # Copy multipath dynamic libraries in case multipath is used (RHEL 6.4 and later) 2784 2800 for d in "/lib" "/usr/lib" "/lib64" "/usr/lib64"; do 2785 if [ -d "$d/multipath" ]; then2801 if [ -d "$d/multipath" -a ! -h $d ]; then 2786 2802 cp -a "$d/multipath" "$mountpoint/$d" 2787 2803 fi
Note:
See TracChangeset
for help on using the changeset viewer.