Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DOING THE MATH:
- ((OFFSET X 512 BYTES) + (SIZE OF tzsw.bin IN BYTES)) / 512
- ((2111 x 512) + 262144) = 1342976 / 512 = 2623 SECTORS
- I had the file size for u-boot.bin originally, but I am still getting over 2048 after correcting this.
- Am I doing something wrong here? I have looked at this a few times. I'll try this calculation again in the morning.
- [alarm@xu4 boot]$ ls -l
- total 4352
- -rw-r--r-- 1 root root 15360 Aug 20 17:07 bl1.bin
- -rw-r--r-- 1 root root 14592 Aug 20 17:07 bl2.bin
- -rw-r--r-- 1 root root 2046 Aug 24 08:57 boot.scr
- -rw-r--r-- 1 root root 1974 Aug 24 08:57 boot.txt
- drwxr-xr-x 2 root root 4096 Aug 24 07:08 dtbs
- -rwxr-xr-x 1 root root 239 Aug 20 17:07 mkscr
- -rwxr-xr-x 1 root root 1746 Aug 20 17:07 sd_fusing.sh
- -rw-r--r-- 1 root root 262144 Aug 20 17:07 tzsw.bin
- -rw-r--r-- 1 root root 543414 Aug 20 17:07 u-boot.bin
- -rwxr-xr-x 1 root root 3592976 Aug 21 12:02 zImage
- [alarm@xu4 boot]$ more sd_fusing.sh
- #!/usr/bin/bash
- ####################################
- #
- # Copyright (C) 2011 Samsung Electronics Co., Ltd.
- # http://www.samsung.com/
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License version 2 as
- # published by the Free Software Foundation.
- #
- ####################################
- #
- # Modified for Arch Linux ARM package uboot-odroid-xu3
- #
- ####################################
- if [ -z $1 ]
- then
- echo "usage: ./sd_fusing.sh <SD Reader's device file>"
- exit 0
- fi
- if [ -b $1 ]
- then
- echo "$1 reader is identified."
- else
- echo "$1 is NOT identified."
- exit 0
- fi
- if [ -d /sys/block/${1##*/}boot0 ]; then
- echo "$1 is an eMMC card, disabling ${1##*/}boot0 ro"
- if ! echo 0 > /sys/block/${1##*/}boot0/force_ro; then
- echo "Enabling r/w for $1boot0 failed"
- exit 1
- fi
- emmc=1
- fi
- ####################################
- # fusing images
- if [ -n "$emmc" ]; then
- signed_bl1_position=0
- bl2_position=30
- uboot_position=62
- tzsw_position=2110
- device=$1boot0
- else
- signed_bl1_position=1
- bl2_position=31
- uboot_position=63
- tzsw_position=2111
- device=$1
- fi
- #<BL1 fusing>
- echo "BL1 fusing"
- dd iflag=dsync oflag=dsync if=./bl1.bin of=$device seek=$signed_bl1_position
- #<BL2 fusing>
- echo "BL2 fusing"
- dd iflag=dsync oflag=dsync if=./bl2.bin of=$device seek=$bl2_position
- #<u-boot fusing>
- echo "u-boot fusing"
- dd iflag=dsync oflag=dsync if=./u-boot.bin of=$device seek=$uboot_position
- #<TrustZone S/W fusing>
- echo "TrustZone S/W fusing"
- dd iflag=dsync oflag=dsync if=./tzsw.bin of=$device seek=$tzsw_position
- ####################################
- #<Message Display>
- echo "U-boot image is fused successfully."
- [alarm@xu4 boot]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement