Ignore:
Timestamp:
Sep 11, 2009, 3:17:46 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • Adds ext3 initrd support for 2.6.30
  • Fix a typo in mondorestore
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/mindi

    r2382 r2391  
    633633    local lcMagicCramfs="<3>cramfs: wrong magic"
    634634    local lcMagicExt2fs="EXT2-fs: blocksize too small for device."
     635    local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device."
    635636    local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as
    636637initramfs"
     
    650651    file $lvKernelImage 2>&1 | grep -q gzip
    651652    if [ $? -eq 0 ]; then
    652         lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"`
     653        lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"`
    653654    else
    654655        # get offet of gzip magic "1f8b0800" in file
     
    659660
    660661        # scan kernel image for initrd filessystem support
    661         lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"`
     662        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"`
    662663    fi
    663664
     
    665666    if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then
    666667        lvUseFilesystem="ext2fs"
     668    elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then
     669        lvUseFilesystem="ext3fs"
    667670    elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then
    668671        lvUseFilesystem="initramfs"
     
    24042407    gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}`
    24052408    [ -z  gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating."
    2406     case "$gvFileSystem" in
    2407     "ext2fs")
     2409    if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ]; then
    24082410        # say what will be used
    2409         LogFile "Creating an ext2 initrd image..."
     2411        LogFile "Creating an $gvFileSystem initrd image..."
    24102412        # kernel expects linuxrc in ext2 filesystem
    24112413        ( cd $mountpoint && ln -sf sbin/init linuxrc )
     
    24192421        # log that we are done
    24202422        LogFile "...done."
    2421     ;;
    2422     "initramfs")
     2423    elif [ "$gvFileSystem" = "initramfs" ]; then
    24232424        # say what will be used
    24242425        LogFile "Creating a gzip'ed cpio (AKA initramfs) initrd image..."
     
    24352436        # log that we are done
    24362437        LogFile "...done."
    2437     ;;
    2438     *)
     2438    else
    24392439        Die "Filesystem $gvFileSystem not supported for initrd image. Terminating."
    2440     ;;
    2441     esac
     2440    fi
     2441
    24422442    if [ "$res" -eq "0" ] ; then
    24432443        echo -en "..."
Note: See TracChangeset for help on using the changeset viewer.