Changeset 2393 in MondoRescue
- Timestamp:
- Sep 11, 2009, 11:56:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi/mindi
r2390 r2393 680 680 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"` 681 681 else 682 # get offet of gzip magic "1f8b0800" in file 682 # Since 2.6.30 kernel can use lzma and bzip2 in addition to gzip for initramfs compression 683 # get offet of gzip magic "1f8b0800" in file (or 1f8b9e ??) 683 684 lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}'` 684 [ $lvOffset -eq 0 ] && Die "gzip magic not found in file $lvKernelImage. Terminating." 685 if [ $lvOffset -eq 0 ]; then 686 # get offet of bzip2 magic "425a" in file 687 lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "425a")}'` 688 if [ $lvOffset -eq 0 ]; then 689 # get offet of lzma magic "5d00" in file 690 lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "5d00")}'` 691 if [ $lvOffset -eq 0 ]; then 692 Die "No magic compression pattern found in file $lvKernelImage. Terminating." 693 else 694 comp="lzma" 695 fi 696 else 697 comp="bzip2" 698 fi 699 else 700 comp="gzip" 701 fi 702 685 703 lvOffset=`expr $lvOffset / 2` 686 echo " GetInitrdFilesystemToUse(): gzip magic foundat lvOffset $lvOffset.\n" >> $LOGFILE704 echo " GetInitrdFilesystemToUse(): $comp magic found in $lvKernelImage at lvOffset $lvOffset.\n" >> $LOGFILE 687 705 688 706 # scan kernel image for initrd filessystem support 689 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"`707 lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | $comp -dc 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"` 690 708 fi 691 709
Note:
See TracChangeset
for help on using the changeset viewer.