-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcduino_build.sh
64 lines (54 loc) · 1.5 KB
/
pcduino_build.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
#!/bin/sh
. ${INCLUDE_DIR}/functions.sh
pwd=$PWD
build_path=$PROFILE_DIR
uboot_kernel_path=${build_path}/sunxi-bsp.git
mkdir -p $build_path
# Kernel
cd $build_path
if [ "$(git --git-dir ${uboot_kernel_path}/.git remote -v | tail -1 | grep '.*sunxi-bsp\.git.*')" = "" ]; then
rm -Rf ${uboot_kernel_path}
echo $build_path
git clone https://github.com/linux-sunxi/sunxi-bsp.git
check_result $?
else
(cd $uboot_kernel_path && git pull)
fi
cd ${uboot_kernel_path}
./configure pcduino
check_result $?
make update
check_result $?
x-terminal-emulator -e "make linux-config"
check_result $?
make
check_result $?
if [ ${TARGET_DIR} != "" ]; then
rm ${TARGET_DIR}/lib/modules/* -Rf
mkdir -p ${TARGET_DIR}/lib/modules/
check_result $?
cp ${uboot_kernel_path}/build/pcduino_hwpack/rootfs/* ${TARGET_DIR}/ -ar
check_result $?
echo "# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on stopped rc or RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty -L 115200 ttyS0 vt102" > ${TARGET_DIR}/etc/init/ttyS0.conf
check_result $?
sync
check_result $?
${CHROOT} userdel ubuntu
${CHROOT} useradd -d /home/ubuntu -s /bin/bash -m -p `mkpasswd ubuntu` ubuntu
check_result $?
sed '/^ubuntu/d' ${TARGET_DIR}/etc/sudoers > ${TARGET_DIR}/etc/sudoers
check_result $?
echo "ubuntu ALL=(ALL) ALL" >> ${TARGET_DIR}/etc/sudoers
check_result $?
else
echo "Error : $TARGET_DIR is empty !" > /dev/stderr
exit 1
fi
cd $pwd