Changeset 1566


Ignore:
Timestamp:
Jul 25, 2007, 5:15:33 PM (12 years ago)
Author:
bruno
Message:

Add support for gzip compressed kernel in mindi (ia64 SLES 10 is in that category)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi/mindi

    r1565 r1566  
    875875    [ ! -f $lvKernelImage ] && Die "File $lvKernelImage not found. Terminating."
    876876
    877     # get offet of gzip magic "1f8b0800" in file
    878     lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}'`
    879     [ $lvOffset -eq 0 ] && Die "gzip magic not found in file $lvKernelImage. Terminating."
    880     lvOffset=`expr $lvOffset / 2`
    881     echo "  GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset.\n" >> $LOGFILE
    882 
    883     # scan kernel image for initrd filessystem support
    884     lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`
     877    # Kernel may be gzip compressed
     878    file $lvKernelImage 2>&1 | grep -q  gzip
     879    if [ $? -eq 0 ]; then
     880        lvScanRes=`gzip -cd $lvKernelImage | strings | grep -e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`
     881    else
     882        # get offet of gzip magic "1f8b0800" in file
     883        lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}'`
     884        [ $lvOffset -eq 0 ] && Die "gzip magic not found in file $lvKernelImage. Terminating."
     885        lvOffset=`expr $lvOffset / 2`
     886        echo "  GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset.\n" >> $LOGFILE
     887
     888        # scan kernel image for initrd filessystem support
     889        lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`
     890    fi
    885891
    886892    # determine which filesystem to use for initrd image: ext2fs, gzip'ed cpio (initramfs ) or cramfs
Note: See TracChangeset for help on using the changeset viewer.