File editbootinstall_a64.sh of Package Teres-I-image

#!/bin/bash

set -x

diskname=$1
devname="$2"
loopname="${devname%*p?}"
loopdev=/dev/${loopname#/dev/mapper/*}

#============================================
# Add a64 SPL area as GPT BIOS boot partition
#--------------------------------------------
#
# A64 reads the secondary program loader (SPL)
# from absolute address 0x2000 or 512-byte
# block 16. Shorten the GPT and allocate that
# space as a partition.
#
# Use tabs, "<<-" strips tabs, but no other whitespace!
cat > gdisk.tmp <<-'EOF'
		x
		s
		56
		l
		1
		m
		n
		56
		16
		2047
		ef02
		w
		y
	EOF
# Because the new partition seriously confuses the kiwi
# repartitioner, disable part56 for now.
cat > gdisk.tmp <<-'EOF'
		x
		s
		56
		w
		y
	EOF
gdisk $loopdev < gdisk.tmp
dd if=boot/u-boot-sunxi-with-spl.bin of=$loopdev \
   conv=notrunc ibs=8k obs=8k seek=1

rm -f gdisk.tmp

# /bin/echo -e 's\nw\ny' | gdisk $loopdev

openSUSE Build Service is sponsored by