"tzsw.bin.hardkernel" "" 2111 512
"params.bin" "" 6272 512
"boot.img" 1 0 512
+ "ramdisk.img" 1 0 512
"rootfs.img" 2 0 4M
"system-data.img" 3 0 4M
"user.img" 5 0 4M
local -r input_size=`du -b $fusing_img | awk '{print $1}'`
print_message 2 "[Fusing $1]"
- dd if=$fusing_img | pv -s $input_size | dd of=$device seek=$seek bs=$bs
+
+ if [ "$(basename $fusing_img)" == "ramdisk.img" ]; then
+ umount $device
+ mkdir mnt_tmp
+ mount -t vfat $device ./mnt_tmp
+ cp -f $fusing_img ./mnt_tmp
+ umount ./mnt_tmp
+ rmdir mnt_tmp
+ echo "fusing $fusing_img is done."
+ else
+ dd if=$fusing_img | pv -s $input_size | dd of=$device seek=$seek bs=$bs
+ fi
if [ $(basename $fusing_img) == "u-boot-mmc.bin" ];then
add_fusing_entry "u-boot" $seek 2048
cd ..
rm -rf $temp_dir
- eval sync
}
-function fuse_image () {
+function check_binary_format () {
+ local -r binary=$1
+
+ case "$binary" in
+ *.tar | *.tar.gz)
+ fuse_image_tarball $binary
+ eval sync
+ ;;
+ *)
+ fusing_image $binary
+ eval sync
+ ;;
+ esac
+}
+function fuse_image () {
if [ "$FUSING_BINARY_NUM" == 0 ]; then
return
fi
+ # NOTE: to ensure ramdisk booting, ramdisk image should be copied after
+ # boot image is flashed into boot partition.
+ #
+ # This code guarantees that ramdisk image is flashed in the end of binaries.
+ local -i tmpval=$FUSING_BINARY_NUM-1
for ((fuse_idx = 0 ; fuse_idx < $FUSING_BINARY_NUM ; fuse_idx++))
do
local filename=${FUSING_BINARY_ARRAY[fuse_idx]}
+ local tmpname=""
case "$filename" in
- *.tar | *.tar.gz)
- fuse_image_tarball $filename
+ *.tar | *.tar.gz)
+ if [ $fuse_idx -lt $tmpval ]; then
+ local tar_contents=`tar tvf $filename | awk 'BEGIN {FS=" "} {print $6}'`
+
+ for content in $tar_contents
+ do
+ if [ "$content" == "ramdisk.img" ]; then
+ tmpname=$filename
+ filename=${FUSING_BINARY_ARRAY[$tmpval]}
+ FUSING_BINARY_ARRAY[$tmpval]=$tmpname
+ break
+ fi
+ done
+ fi
+ check_binary_format $filename
;;
- *)
- fusing_image $filename
+ *)
+ if [ $fuse_idx -lt $tmpval ]; then
+ if [ "$filename" == "ramdisk.img" ]; then
+ tmpname=$filename
+ filename=${FUSING_BINARY_ARRAY[$tmpval]}
+ FUSING_BINARY_ARRAY[$tmpval]=$tmpname
+ fi
+ fi
+ check_binary_format $filename
;;
esac
done
function mkpart_3 () {
# NOTE: if your sfdisk version is less than 2.26.0, then you should use following sfdisk command:
# sfdisk --in-order --Linux --unit M $DISK <<-__EOF__
-
+ #
# NOTE: sfdisk 2.26 doesn't support units other than sectors and marks --unit option as deprecated.
# The input data needs to contain multipliers (MiB) instead.
local version=`sfdisk -v | awk '{print $4}'`
function print_logo () {
echo ""
- echo "Odroid-XU3/4 downloader"
+ echo "[Odroid-XU3/4 downloader]"
+ echo "This version also supports Tizen 4.0."
echo ""
}