Changeset 1730


Ignore:
Timestamp:
Oct 29, 2007, 1:47:34 PM (12 years ago)
Author:
bruno
Message:

Attempt to fix a bug in supporting OpenSusE 10.3 kernel for initramfs
(mindi may now use multiple regex for kernel initrd detection)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi/mindi

    r1729 r1730  
    879879    local lcMagicCramfs="<3>cramfs: wrong magic"
    880880    local lcMagicExt2fs="<3>EXT2-fs: blocksize too small for device."
    881     local lcMagicInitfs="<6>checking if image is initramfs..."
     881    local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs..."
    882882
    883883    # local variables
     
    893893
    894894    # Kernel may be gzip compressed
    895     file $lvKernelImage 2>&1 | grep -q  gzip
     895    file $lvKernelImage 2>&1 | grep -q gzip
    896896    if [ $? -eq 0 ]; then
    897         lvScanRes=`gzip -cd $lvKernelImage | strings | grep -e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`
     897        lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"`
    898898    else
    899899        # get offet of gzip magic "1f8b0800" in file
     
    904904
    905905        # scan kernel image for initrd filessystem support
    906         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"`
     906        lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"`
    907907    fi
    908908
    909909    # determine which filesystem to use for initrd image: ext2fs, gzip'ed cpio (initramfs ) or cramfs
    910     if [ `echo $lvScanRes | grep -c "$lcMagicExt2fs"` -eq 1 ]; then
     910    if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then
    911911        lvUseFilesystem="ext2fs"
    912     elif [ `echo $lvScanRes | grep -c "$lcMagicInitfs"` -eq 1 ]; then
     912    elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then
    913913        lvUseFilesystem="initramfs"
    914     elif [ `echo $lvScanRes | grep -c "$lcMagicCramfs"` -eq 1 ]; then
     914    elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then
    915915        lvUseFilesystem="cramfs"
    916916    else
Note: See TracChangeset for help on using the changeset viewer.