-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcduino_install.sh
43 lines (35 loc) · 1.02 KB
/
pcduino_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
#!/bin/sh
. ${INCLUDE_DIR}/functions.sh
pwd=$PWD
build_path=$PROFILE_DIR
uboot_kernel_path=${build_path}/pcduino-uboot-kernel
# Kernel
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