@spartak73: I use this modified flash_part_w_fw.sh file to create root.img:
The file replaces the file with the same name in the ../flash/hs7810a/scripts folder and is called from the flash shell script.Code:#!/bin/bash #Version for Fortis HS-7810A with loader 6.26 (boot from USB, not flash) if [ `id -u` != 0 ]; then echo "You are not running this script as root. Try it again as root or with su/sudo command." echo "Bye Bye..." exit fi CURDIR=$1 TUFSBOXDIR=$2 OUTDIR=$3 TMPKERNELDIR=$4 TMPROOTDIR=$5 echo "CURDIR = $CURDIR" echo "TUFSBOXDIR = $TUFSBOXDIR" echo "OUTDIR = $OUTDIR" echo "TMPKERNELDIR = $TMPKERNELDIR" echo "TMPROOTDIR = $TMPROOTDIR" MKFSEXT3=mke2fs OUTFILE=root.img if [ ! -e $OUTDIR ]; then mkdir $OUTDIR fi if [ -e $OUTFILE ]; then rm -f $OUTFILE fi if [ ! -e /mnt/temp ]; then sudo mkdir /mnt/temp fi echo "-----------------------------------------------------------------------------" # --- KERNEL --- # Size is 8MB max. echo "" echo "Copying kernel file..." cp -f $TMPKERNELDIR/uImage $OUTDIR/uImage #padding of kernel uImage is not needed #$PAD 0x800000 $CURDIR/uImage $CURDIR/mtd_kernel.pad.bin echo "-----------------------------------------------------------------------------" # --- ROOT --- # Size is 256MB echo "" echo "Creating root image file..." #Create an empty file of 256M size echo "dd if=/dev/zero of=$CURDIR/ext3.img bs=512 count=512000" dd if=/dev/zero of=$CURDIR/ext3.img bs=512 count=512000 #Attach it to a loop device echo "sudo losetup /dev/loop0 $CURDIR/ext3.img" sudo losetup /dev/loop0 $CURDIR/ext3.img #Create an ext3 file system in the empty file echo "sudo $MKFSEXT3 -t ext3 -L root.img /dev/loop0" sudo $MKFSEXT3 -t ext3 -L root.img /dev/loop0 #Detach the loop device echo "sudo losetup -d /dev/loop0" sudo losetup -d /dev/loop0 #Mount $CURDIR/ext3.img on a temporary mount echo "sudo mount -t ext3 $CURDIR/ext3.img /mnt/temp" sudo mount -t ext3 $CURDIR/ext3.img /mnt/temp #Copy the root file system to the mount echo "cp -r -f -p $TMPROOTDIR/* /mnt/temp" cp -r -f -p $TMPROOTDIR/* /mnt/temp #Create a swap directory echo "Create a swap directory if not already done" if [ ! -e /mnt/temp/swap ]; then sudo mkdir /mnt/temp/swap fi #Unmount $CURDIR/ext3.img on the temporary mount echo "sudo umount /mnt/temp" sudo umount /mnt/temp echo "-----------------------------------------------------------------------------" echo "" echo "Preparation of root image file completed," echo "checking file sizes..." SIZE=`stat $TMPKERNELDIR/uImage -t --format %s` SIZE=`printf "0x%x" $SIZE` if [[ $SIZE > "0x800000" ]]; then echo "KERNEL TOO BIG. $SIZE instead of 0x800000" > /dev/stderr else echo "Kernel (uImage) is $SIZE bytes... OK" fi SIZE=`stat ext3.img -t --format %s` SIZE=`printf "0x%x" $SIZE` if [[ $SIZE > "0xfffffff" ]]; then echo "ROOT TOO BIG. $SIZE instead of 0x10000000" > /dev/stderr else echo "Root image file is $SIZE bytes... OK" fi mv $CURDIR/ext3.img $OUTDIR/$OUTFILE echo "-----------------------------------------------------------------------------" echo "" echo "Creating zip-file..." cd $OUTDIR;zip $OUTFILE.zip $OUTFILE uImage
After running this, you have the correct root.img, but uImage still has got a problem I have not solved yet and is addressed in this thread. I suspect it has something to do with a missing or empty initramfs.
Regards,
Audioniek.