Changeset 2390


Ignore:
Timestamp:
Sep 11, 2009, 3:05:20 AM (9 years ago)
Author:
bruno
Message:
  • Adds ext3 initrd support for 2.6.30
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/mindi

    r2380 r2390  
    660660    local lcMagicCramfs="<3>cramfs: wrong magic"
    661661    local lcMagicExt2fs="EXT2-fs: blocksize too small for device."
     662    local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device."
    662663    local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as
    663664initramfs"
     
    677678    file $lvKernelImage 2>&1 | grep -q gzip
    678679    if [ $? -eq 0 ]; then
    679         lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"`
     680        lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"`
    680681    else
    681682        # get offet of gzip magic "1f8b0800" in file
     
    686687
    687688        # scan kernel image for initrd filessystem support
    688         lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"`
     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"`
    689690    fi
    690691
     
    692693    if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then
    693694        lvUseFilesystem="ext2fs"
     695    elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then
     696        lvUseFilesystem="ext3fs"
    694697    elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then
    695698        lvUseFilesystem="initramfs"
     
    24032406    gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}`
    24042407    [ -z  gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating."
    2405     case "$gvFileSystem" in
    2406     "ext2fs")
     2408    if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ]; then
    24072409        # say what will be used
    2408         echo "Creating an ext2 initrd image..." >> $LOGFILE
     2410        echo "Creating an $gvFileSystem initrd image..." >> $LOGFILE
    24092411        # kernel expects linuxrc in ext2 filesystem
    24102412        ( cd $mountpoint && ln -sf sbin/init linuxrc )
     
    24182420        # log that we are done
    24192421        echo "...done." >> $LOGFILE
    2420     ;;
    2421     "initramfs")
     2422    elif [ "$gvFileSystem" = "initramfs" ]; then
    24222423        # say what will be used
    24232424        echo "Creating a gzip'ed cpio (AKA initramfs) initrd image..." >> $LOGFILE
     
    24342435        # log that we are done
    24352436        echo "...done." >> $LOGFILE
    2436     ;;
    2437     *)
     2437    else
    24382438        Die "Filesystem $gvFileSystem not supported for initrd image. Terminating."
    2439     ;;
    2440     esac
     2439    fi
     2440
    24412441    if [ "$res" -eq "0" ] ; then
    24422442        echo -en "..."
Note: See TracChangeset for help on using the changeset viewer.