Changeset 3107 in MondoRescue for branches/3.0/mindi
- Timestamp:
- May 5, 2013, 4:23:30 AM (11 years ago)
- Location:
- branches/3.0/mindi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mindi/README.pxe
r3098 r3107 11 11 label mondo 12 12 kernel vmlinuz-mondo 13 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 selinux=0 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs |smbfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [hwaddr=M:A:C:A:D:R] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ...13 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 selinux=0 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [hwaddr=M:A:C:A:D:R] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ... 14 14 15 15 ipdev is the device name (e.g. eth2) … … 20 20 dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface. 21 21 hwaddr is the MAC address of the device you want to use to restore through 22 proto is the protocol to use for mounting the remote share (default is NFS, sshfs and smbfs arealso available)22 proto is the protocol to use for mounting the remote share (default is NFS, sshfs is also available) 23 23 server is the ip addr of the Remote Network server 24 24 mountpoint is the mount point on the Remote Network server to use (if NFS, should be in /etc/exports of the NFS server) -
branches/3.0/mindi/mindi
r3103 r3107 756 756 757 757 # say where we are. 758 LogFile "INFO: GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"758 LogFile "INFO: GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage" 759 759 760 760 # verify that file exists 761 761 [ ! -f $lvKernelImage ] && Die "File $lvKernelImage not found. Terminating." 762 762 763 # Kernel may be gzip compressed - Case of RHEL5 - SLES11SP1763 # Kernel may be gzip compressed 764 764 file $lvKernelImage 2>&1 | grep -q gzip 765 765 if [ $? -eq 0 ]; then 766 LogFile "INFO: Found a gzip compressed kernel $lvKernelImage" 767 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null` 768 else 769 LogFile "INFO: Found a non gzip compressed kernel $lvKernelImage" 770 # kernel is x86 boot sector in RHEL3/4 with embedded gzip content 771 # get offet of gzip magic "1f8b0800" in file (for these older kernels) 772 lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}' 2> /dev/null` 773 if [ $lvOffset -eq 0 ]; then 774 LogFile "INFO: gzip magic not found in file $lvKernelImage. Supposing initramfs." 775 lvScanRes=$lcMagicInitfs 766 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"` 767 768 # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs 769 if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then 770 lvUseFilesystem="ext2fs" 771 elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then 772 lvUseFilesystem="ext3fs" 773 elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then 774 lvUseFilesystem="initramfs" 775 elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then 776 lvUseFilesystem="cramfs" 776 777 else 777 lvOffset=`expr $lvOffset / 2` 778 LogFile "INFO: GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset." 779 # scan again kernel image 780 lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null` 781 fi 782 fi 783 784 # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs 785 if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then 786 lvUseFilesystem="ext2fs" 787 elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then 788 lvUseFilesystem="ext3fs" 789 elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then 778 lvUseFilesystem="UNSUPPORTED" 779 fi 780 781 else 782 # In that case, we are after 2.6.30 and use the supported initramfs 790 783 lvUseFilesystem="initramfs" 791 elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then 792 lvUseFilesystem="cramfs" 793 else 794 # In that case, we are most probably after 2.6.30 and use the supported initramfs 795 LogFile "No automatic detection found previously. Supposing initramfs." 796 LogFile "Report on the MondoRescue mailing-list withyour log files" 797 lvUseFilesystem="initramfs" 798 fi 799 784 fi 800 785 # say what we are using 801 LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem."786 LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem." 802 787 803 788 # return file system to use … … 937 922 file="$1" 938 923 939 while [ `echo $file | grep -Ec '\.\./'` -ne 0 ]; do 924 echo $file | grep -q '\.\./' 925 if [ $? -eq 0 ]; then 940 926 # We need to normalise the path with .. in it 941 file=`echo $file | perl -pi -e 's|([^/] *)/([^/]+)/\.\./([^/]+)|$1/$3|g'`942 done927 file=`echo $file | perl -pi -e 's|([^/]+)/([^/]+)/\.\./([^/]+)|$1/$3|'` 928 fi 943 929 echo "$file" 944 930 if [ ! -h $file ]; then … … 1818 1804 for i in $options ; do 1819 1805 ooo=$i 1820 [ "$ooo" = "RESTORE" ] && ooo=" RESTOREnuke"1806 [ "$ooo" = "RESTORE" ] && ooo="nuke" 1821 1807 if [ "$type" = "elilo" ]; then 1822 1808 outstr="image=/vmlinuz\n\tlabel=$i\n\tinitrd=/initrd.img\n\troot=/dev/ram0 append=\" rw ramdisk_size=$ramdisk_size $ooo $MINDI_ADDITIONAL_BOOT_PARAMS \"\n" … … 2602 2588 fi 2603 2589 done 2604 tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt " WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log2590 tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "ERROR: Problem in minimal analysis" $MINDI_TMP/$$.log 2605 2591 2606 2592 # To improve support for distribution scripts, we now prefer to use bash as the std shell. Also fixes #600 … … 3245 3231 3246 3232 for i in loop cdrom ide-cd isofs linear raid0 raid1 raid5 ; do 3247 modinfo $i2> /dev/null 1> /dev/null3233 modinfo 2> /dev/null 1> /dev/null 3248 3234 if [ $? -eq 0 ]; then 3249 3235 modprobe $i 2>&1 > /dev/null -
branches/3.0/mindi/rootfs/sbin/start-netfs
r3098 r3107 104 104 ln -sf /dev/console /dev/tty 105 105 sshfs -o ro,StrictHostKeyChecking=no $netfsopt $netfsmount /tmp/isodir 106 elif [ "$proto" = "smbfs" ]; then107 LogIt "Mounting SMBFS share ($netfsmount) on /tmp/isodir..."108 mount -t cifs $netfsopt $netfsmount /tmp/isodir -o ro109 106 elif [ "$proto" != "" ]; then 110 107 if [ -x /sbin/rpcbind ]; then
Note:
See TracChangeset
for help on using the changeset viewer.