forked from cubieboard/linux-sunxi
-
Notifications
You must be signed in to change notification settings - Fork 9
/
makeuimage
executable file
·41 lines (36 loc) · 1.82 KB
/
makeuimage
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
# makeuimage [<output-directory> [<make-args>]]
# Builds armhf kernel and puts output in the subdirectory output/<output-directory>.
# If <output-directory> isn't specified, it's set to "sun4i_default".
# If <make-args> is specified, these are passed to make; otherwise, the kernel and modules
# are built and then installed in output/<output-directory>/output/boot and
# output/<output-directory>/output/lib. If output/<output-directory> is being created for
# the first time and no configuration has been set, sun4i_defconfig is used.
#
# Examples:
# makeuimage 3.4.61-sun7i+ sun7i_defconfig # first time setup of output/3.4.61-sun7i+
# makeuimage 3.4.61-sun7i+ menuconfig # run menuconfig on output/3.4.61-sun7i+
# makeuimage 3.4.61-sun7i+ # build kernel and modules
kernel_release=${1:-sun4i_default}
mkdir -p output/$kernel_release
if [ $# -lt 2 -a ! -f output/$kernel_release/.config ]
then
make O=output/$kernel_release ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun4i_defconfig
fi
if [ $# -gt 1 ]
then
shift
make O=output/$kernel_release ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- $*
exit
fi
make O=output/$kernel_release ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage
mkdir -p output/$kernel_release/output/boot
echo copy output/$kernel_release/arch/arm/boot/uImage to output/$kernel_release/output/boot/uImage.$kernel_release
cp -a output/$kernel_release/arch/arm/boot/uImage output/$kernel_release/output/boot/uImage.$kernel_release
cp -a output/$kernel_release/.config output/$kernel_release/output/boot/config.$kernel_release
echo -n "make modules? (Y/n)"
read yn
if [ "$yn" != n ]
then
make O=output/$kernel_release ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 modules
make O=output/$kernel_release ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=output modules_install
fi