-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathinstall_hdr_mod
executable file
·63 lines (55 loc) · 1.67 KB
/
install_hdr_mod
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
if [ $# -ne 1 ] ; then
echo "Usage: $0 <device>"
echo "Where <device> is name of root filesystem device, e.g. sda3, sdb3, mmcblk0p3, etc."
exit 1
fi
mkdir mount_point/ &&\
sudo mount /dev/$1 mount_point/ &&\
(
echo "Installing kernel modules to device $1"
INSTALL_MOD_PATH=mount_point/ sudo -E make modules_install >/dev/null 2>&1
if [ $? -ne "0" ] ; then
echo "Failed to install modules to device $1"
exit 1
fi
) &&\
(
echo "Installing kernel headers to device $1"
INSTALL_HDR_PATH=mount_point/ sudo -E make headers_install >/dev/null 2>&1
if [ $? -ne "0" ] ; then
echo "Failed to install kernel headers to device $1"
exit 1
fi
) &&\
(
cd compat-drivers-3.8.3-2-snpu &&\
echo "Installing external wireless modules to device $1"
KLIB_BUILD=`pwd`/../ ARCH=arm CROSS_COMPILE=`pwd`/../cross-toolchain/arm-fsl-linux-gnueabi/bin/arm-linux- INSTALL_MOD_PATH=mount_point/ sudo -E make install-modules >/dev/null 2>&1
if [ $? -ne "0" ] ; then
echo "Failed to install external wireless modules to device $1"
exit 1
fi
) &&\
(
echo "Copying SPI and NAND bootstreams to device $1"
sudo -E cp imx-bootlets-src-10.12.01/imx28_ivt_linux.s* mount_point/lib/modules/
if [ $? -ne "0" ] ; then
echo "Failed to failed to copy bootstream files to device $1"
exit 1
fi
) &&\
(
if [ -e arch/arm/boot/uImage ] ; then
echo "Copying U-Boot kernel to device $1"
sudo -E cp arch/arm/boot/uImage mount_point/boot
if [ $? -ne "0" ] ; then
echo "Failed to failed to copy U-Boot kernel to device $1"
exit 1
fi
else
echo "U-Boot kernel does not exist, skipping"
fi
)
sudo umount mount_point
rmdir mount_point