summaryrefslogtreecommitdiffstats
path: root/tegra-install-kernel.sh
blob: c48f8b04b8f7571ccba34b327747f94ea8bb8e4d (plain) (blame)
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
#!/bin/sh

if [ $# -ne 1 ] ; then
	error "Usage: `basename $0` <REMOTE-KDIR>"
fi

. $(dirname $0)/arm-installer-common.sh

LOAD_ADDR=0x81008000
ENTRY_POINT=0x81008000

USB_PART=/dev/sdb1
TMP_MOUNT=$(mktemp -d)
# Use default boot image name on Tegra instead of creating a new boot script
# The tegra cannot install a new boot script without manual labor
BOOT_IMAGE=vmlinux.uimg

KVERSION=$(getversion)
CONFIG_FILE="config-$KVERSION"

fetchfiles

mkuboot

moveconfig

echo "Mounting USB partition ..." >&2
sudo mount $USB_PART $TMP_MOUNT
echo "done." >&2

if [ ! -d "$TMP_MOUNT/boot" ]; then
    sudo rm -f "$TMP_MOUNT/boot"
    sudo mkdir "$TMP_MOUNT/boot"
fi
sudo cp $out_image "$TMP_MOUNT/boot/$BOOT_IMAGE"

echo "Unmounting USB partition ..." >&2
sudo umount $TMP_MOUNT
echo "done." >&2

rm_tmp_files
rm -rf $TMP_MOUNT

echo "All done!" >&2