summaryrefslogtreecommitdiff
path: root/examples/wandboard-customise.sh
blob: f16cff0d48aac5738645f58d5506ff06658bbd32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

set -e

rootdir=$1
image=$2

if [ -z "${image}" ]; then
	echo "Image not specified"
	exit
fi

if [ ! -f '/usr/lib/u-boot/wandboard_quad/u-boot.imx' ]; then
	echo "Unable to find wandboard u-boot file"
	exit
fi

# u-boot needs to be dd'd to the device, not a partition
# but kpartx does not setup the device, just the partitions

dd if=/usr/lib/u-boot/wandboard_quad/u-boot.imx of=${image} seek=1 conv=fsync bs=1k

mkdir -p $rootdir/boot/dtbs
cp $rootdir/usr/lib/linux-image-*-armmp/* $rootdir/boot/dtbs

for module in ahci_platform ahci_imx sd-mod; do
	echo ${module} >> ${rootdir}/etc/initramfs-tools/modules 
done