-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·68 lines (54 loc) · 1.64 KB
/
install.sh
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
64
65
66
67
68
#!/bin/bash -e
set +x
if [ "x$LINUX_VERSION" == "x" ]; then
LINUX_VERSION=$1
fi
if [ "x$LINUX_VERSION" == "x" ]; then
echo "\$LINUX_VERSION not set"
exit 1
fi
echo "$0: \$LINUX_VERSION='$LINUX_VERSION'"
if [ ! -e $(dirname $0)/"linux-$LINUX_VERSION" ]; then
echo "Directory linux-$LINUX_VERSION not found"
exit 1
fi
# check if we can use sparse
which sparse > /dev/null
if [ "$?" = "0" ]; then
SPARSE_CHECK="C=1"
else
echo "**** WARNING: you do not have sparse installed"
echo "**** run: \"sudo apt-get install sparse\" to install it"
echo ""
SPARSE_CHECK=""
fi
# count number of CPUs for make
if [ -z "$CPUS" ]
then
export CPUS=`echo /sys/devices/system/cpu/cpu[0-9]* | wc -w`
[ "$CPUS" -lt 1 ] && export CPUS=1
fi
pushd $(dirname $0)/linux-$LINUX_VERSION/
# check for .config. Use defconfig if it's not there.
if [ ! -e ".config" ]; then
if [ "x$TARGET_MACH" == "x" ]; then
export TARGET_MACH=nxp4330_vtk_lcd_defconfig
echo "*** Using default NXP43300 VTK form factor Board config file '$TARGET_MACH'."
fi
if [ ! -e "arch/arm/configs/$TARGET_MACH" ]; then
echo "Machine configuration '$TARGET_MACH' not found, expected a filename from arch/arm/configs."
exit 1
fi
echo "TARGET_MACH="$TARGET_MACH
make ARCH=arm -j $CPUS $TARGET_MACH
fi
echo "TARGET_MACH="$TARGET_MACH
make ARCH=arm -j $CPUS $SPARSE_CHECK KALLSYMS_EXTRA_PASS=1 uImage
make ARCH=arm -j $CPUS $SPARSE_CHECK KALLSYMS_EXTRA_PASS=1 zImage
MODS=`grep CONFIG_MODULES include/config/auto.conf`
if [ "$MODS" != "" ]; then
make ARCH=arm -j $CPUS modules
echo INSTALL_MOD_PATH=$ROOTFS_PATH
make ARCH=arm -j $CPUS modules_install INSTALL_MOD_PATH=$ROOTFS_PATH
fi
popd