aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
blob: 52fce33f7248abde4c6f080569e8ede8f7787500 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
set -e

flash_fastboot()
{
	fastboot flash BOOT arch/arm/boot/boot.img
	sleep 1
	fastboot flash RECOVERY arch/arm/boot/boot.img
	sleep 1
	fastboot reboot
	echo "OK"
}

flash_heimdall()
{
	heimdall flash \
		--BOOT arch/arm/boot/boot.img \
		--RECOVERY arch/arm/boot/boot.img
	echo "OK"
}

install_parabola_no_modules()
{
  host="$1"

  rsync arch/arm/boot/zImage "${host}:/boot/vmlinuz-linux-custom"
  rsync arch/arm/boot/dts/*.dtb "${host}:/boot/dtbs/linux-custom/"
  rsync -a tests "${host}:"

  ssh "${host}" "test -f /boot/initramfs-linux-custom.img || mkinitcpio -p linux-custom"
}

usage()
{
	echo "Usage: $0 <fastboot|heimdall>"
	echo "Usage: $0 parabola <host>"
	exit 1
}

if [ $# -eq 1 -a "$1" = "fastboot" ] ; then
	flash_fastboot
elif [ $# -eq 1 -a "$1" = "heimdall" ] ; then
	flash_heimdall
elif [ $# -eq 2 -a "$1" = "parabola" ] ; then
	install_parabola_no_modules "$2"
else
	usage
fi