在ubuntu20.04的本地编译全志R系列的步骤20
2020/6/14 14 7:51 开始写
2020/6/14 14 14:48 完工
0、获取全志R系列的Android源码包:
请通过渠道/代理商/方案公司获取全志R系列的Android源码包。
1、安装ubuntu
已经验证过的系统:ubuntu-14.04-desktop-amd64.iso
ubuntu的官方下载地址(喜欢中文优化版本的,可以选择麒麟版本):
http://releases.ubuntu.com/releases/20.04/
http://cdimage.ubuntu.com/releases/
http://old-releases.ubuntu.com/releases/lucid/
http://cn.ubuntu.com/
http://www.ubuntukylin.com/
https://www.ubuntu.com/download/ubuntu-kylin
如果没有特殊理由,推荐使用ubuntu长期支持的版本(LTS版本)比如:
ubuntu-20.04-desktop-amd64.iso 2020-04-23 07:52 2.5G Desktop image for 64-bit PC (AMD64) computers (standard download)
安装Ubuntu的教程请参考:
http://digi.163.com/11/0127/18/6RE3LQL400162OUT.html
图文教程:手把手教你用U盘安装Ubuntu
http://www.linuxidc.com/Linux/2012-11/74695.htm
U盘安装Ubuntu 12.10
http://jingyan.baidu.com/article/a3761b2b66fe141577f9aa51.html
怎么用u盘安装ubuntu
手动分区的建议设置:
/boot 内核启动分区。建议分配500MB,不建议低于100MB。
swap 交换分区。建议:8192MB,不建议低于4096MB。
/home home分区,建议为剩下的容量-50GB(/分区的容量)
/ 根分区,注意这里需要设置为主分区!!!!建议50GB,不小于20GB。
小知识:
查看ubuntu的版本:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ cat /etc/issue
Ubuntu 20.04 LTS \n \l
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ uname -a
Linux rootroot-HP-ZHAN-66-Pro-A-14-G3 5.4.0-37-generic #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
http://www.360doc.com/content/13/0921/23/6496277_316103639.shtml
查看ubuntu是32位还是64位的方法及其版本号
http://www.cnblogs.com/zero1665/archive/2010/05/24/1742962.html
查看ubuntu版本号
获取当前电脑配置的IP地址:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.186.206 netmask 255.255.255.0 broadcast 192.168.186.255
inet6 fe80::19ca:5fb:e795:9d47 prefixlen 64 scopeid 0x20<link>
ether b0:5c:da:21:3a:e5 txqueuelen 1000 (Ethernet)
RX packets 189714 bytes 260336999 (260.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 98817 bytes 9265147 (9.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2952 bytes 451064 (451.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2952 bytes 451064 (451.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.186.204 netmask 255.255.255.0 broadcast 192.168.186.255
inet6 fe80::f109:85c9:1b56:8cf7 prefixlen 64 scopeid 0x20<link>
ether b8:9a:2a:d2:ac:df txqueuelen 1000 (Ethernet)
RX packets 76966 bytes 111583331 (111.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23182 bytes 2136601 (2.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ lshw -C network
WARNING: you should run this program as super-user.
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: enp1s0
version: 15
serial: b0:5c:da:21:3a:e5
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.186.206 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:51 ioport:3000(size=256) memory:e0a04000-e0a04fff memory:e0a00000-e0a03fff
*-network
description: Wireless interface
product: Wi-Fi 6 AX200
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlp2s0
version: 1a
serial: b8:9a:2a:d2:ac:df
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=5.4.0-37-generic firmware=48.4fa0041f.0 ip=192.168.186.204 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:51 memory:e0900000-e0903fff
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
2、全志R系列的android的环境搭建:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo passwd root
[sudo] password for rootroot:
New password:
Retype new password:
passwd: password updated successfully
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
(1)更新
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
ubuntu-desktop ubuntu-desktop-minimal ubuntu-drivers-common
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Get:2 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [18.7 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [31.5 kB]
Hit:4 http://cn.archive.ubuntu.com/ubuntu focal InRelease
Get:5 http://cn.archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [103 kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [106 kB]
Get:9 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [151 kB]
Get:10 http://cn.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [532 B]
Fetched 722 kB in 8s (86.6 kB/s)
Reading package lists... Done
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
(2)
首先安装openssh-server,这样就可以在Windows下通过SSH软件连接Ubuntu的电脑操作了。
sudo apt-get install openssh-server
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-server is already the newest version (1:8.2p1-4).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ps -e | grep ssh
1435 ? 00:00:00 ssh-agent
4864 ? 00:00:00 sshd
5911 ? 00:00:00 sshd
6047 ? 00:00:00 sshd
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ op
openssl openvpn openvt opldecode
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ op
openssl openvpn openvt opldecode
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ss
ss ssh ssh-add ssh-agent ssh-argv0 ssh-copy-id sshd ssh-import-id ssh-import-id-gh ssh-import-id-lp ssh-keygen ssh-keyscan
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ss
ss ssh ssh-add ssh-agent ssh-argv0 ssh-copy-id sshd ssh-import-id ssh-import-id-gh ssh-import-id-lp ssh-keygen ssh-keyscan
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sshd -verison
unknown option -- v
OpenSSH_8.2p1 Ubuntu-4, OpenSSL 1.1.1f 31 Mar 2020
usage: sshd [-46DdeiqTt] [-C connection_spec] [-c host_cert_file]
[-E log_file] [-f config_file] [-g login_grace_time]
[-h host_key_file] [-o option] [-p port] [-u len]
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ openssl -version
Invalid command '-version'; type "help" for a list.
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ openssl -v
Invalid command '-v'; type "help" for a list.
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ openssl --version
Invalid command '--version'; type "help" for a list.
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
(3)
安装samba:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install samba
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ samba --version
Version 4.11.6-Ubuntu
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ps -e | grep smb
7366 ? 00:00:00 smbd
7368 ? 00:00:00 smbd-notifyd
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ cd /etc/samba/
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ ll
total 36
drwxr-xr-x 3 root root 4096 6月 14 08:08 ./
drwxr-xr-x 131 root root 12288 6月 14 08:08 ../
-rw-r--r-- 1 root root 8 5月 1 03:17 gdbcommands
-rw-r--r-- 1 root root 8942 6月 14 08:08 smb.conf
drwxr-xr-x 2 root root 4096 5月 1 03:17 tls/
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ sudo cp smb.conf smb.conf.bak1
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
你可以通过vi在root权限下直接修改。
我是通过WinSCP5.15.9将smb.conf拷贝到Win7的C盘下改好了再拷贝回去的!
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ cp smb.conf ~
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ cd ~
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ll
total 2008196
drwxr-xr-x 16 rootroot rootroot 4096 6月 14 08:13 ./
drwxr-xr-x 4 root root 4096 6月 13 11:56 ../
-rw------- 1 rootroot rootroot 289 6月 13 12:46 .bash_history
-rw-r--r-- 1 rootroot rootroot 220 6月 13 11:56 .bash_logout
-rw-r--r-- 1 rootroot rootroot 3771 6月 13 11:56 .bashrc
drwx------ 14 rootroot rootroot 4096 6月 14 08:01 .cache/
drwxr-xr-x 13 rootroot rootroot 4096 6月 13 12:46 .config/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Desktop/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Documents/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Downloads/
drwx------ 3 rootroot rootroot 4096 6月 13 12:16 .gnupg/
drwxr-xr-x 3 rootroot rootroot 4096 6月 13 12:05 .local/
drwx------ 5 rootroot rootroot 4096 6月 14 07:45 .mozilla/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Music/
-rw-rw-r-- 1 rootroot rootroot 8977887 6月 13 12:27 my_video-1.mkv
-rw-rw-r-- 1 rootroot rootroot 35531753 6月 13 12:28 my_video-2.mkv
-rw-rw-r-- 1 rootroot rootroot 45847173 6月 13 12:35 my_video-3.mkv
-rw-rw-r-- 1 rootroot rootroot 5055327 6月 13 12:35 my_video-4.mkv
-rw-rw-r-- 1 rootroot rootroot 809570438 6月 13 12:46 my_video-5.mkv
-rw-rw-r-- 1 rootroot rootroot 1151287838 6月 14 08:13 my_video-6.mkv
drwxr-xr-x 2 rootroot rootroot 4096 6月 14 07:45 Pictures/
-rw-r--r-- 1 rootroot rootroot 807 6月 13 11:56 .profile
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Public/
-rw-r--r-- 1 rootroot rootroot 8942 6月 14 08:13 smb.conf
drwx------ 2 rootroot rootroot 4096 6月 13 12:16 .ssh/
-rw-r--r-- 1 rootroot rootroot 0 6月 13 12:17 .sudo_as_admin_successful
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Templates/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Videos/
-rw------- 1 rootroot rootroot 154 6月 14 08:13 .Xauthority
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo chmod 777 smb.conf
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ cd -
/etc/samba
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ ll
total 48
drwxr-xr-x 3 root root 4096 6月 14 08:12 ./
drwxr-xr-x 131 root root 12288 6月 14 08:08 ../
-rw-r--r-- 1 root root 8 5月 1 03:17 gdbcommands
-rw-r--r-- 1 root root 8942 6月 14 08:08 smb.conf
-rw-r--r-- 1 root root 8942 6月 14 08:12 smb.conf.bak1
drwxr-xr-x 2 root root 4096 5月 1 03:17 tls/
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ sudo cp ~/smb.conf .
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ ll
total 48
drwxr-xr-x 3 root root 4096 6月 14 08:12 ./
drwxr-xr-x 131 root root 12288 6月 14 08:08 ../
-rw-r--r-- 1 root root 8 5月 1 03:17 gdbcommands
-rw-r--r-- 1 root root 9148 6月 14 08:16 smb.conf
-rw-r--r-- 1 root root 8942 6月 14 08:12 smb.conf.bak1
drwxr-xr-x 2 root root 4096 5月 1 03:17 tls/
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ diff smb.conf smb.conf.bak1
219,230d218
< [rootroot]
< comment=rootroot Shared Folder
< path=/
< #public=yes
< writable=yes
< #readonly=yes
< valid users=rootroot
< create mask=0700
< directory mask=0700
< available=yes
< browseable=yes
<
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo smbpasswd -a rootroot
New SMB password:
Retype new SMB password:
Added user rootroot.
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
(4)
安装编译全志的android4所需要的软件:
安装前先看一下gcc/g++:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/etc/samba$ cd ~
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ gcc -v
Command 'gcc' not found, but can be installed with:
sudo apt install gcc
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ g++ -v
Command 'g++' not found, but can be installed with:
sudo apt install g++
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
正式安装:
sudo apt-get install git-core
sudo apt-get install gnupg
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install gperf
sudo apt-get install build-essential
sudo apt-get install zip
sudo apt-get install curl
sudo apt-get install libc6-dev
sudo apt-get install libncurses5-dev
sudo apt-get install x11proto-core-dev
sudo apt-get install libx11-dev:i386
sudo apt-get install libreadline6-dev:i386
sudo apt-get install libgl1-mesa-glx:i386
sudo apt-get install libgl1-mesa-dev
sudo apt-get install g++-multilib
sudo apt-get install mingw32
sudo apt-get install tofrodos
sudo apt-get install python-markdown
sudo apt-get install libxml2-utils
sudo apt-get install xsltproc
sudo apt-get install zlib1g-dev:i386
sudo apt-get install zlib1g-dev
sudo apt-get install lib32ncurses5-dev
sudo apt-get install lib32z1
sudo apt-get install libx11-dev
sudo apt-get install lib32z1-dev
sudo apt-get install libreadline6-dev
sudo apt-get install libgl1-mesa-glx
sudo apt-get install u-boot-tools
sudo apt-get install libssl-dev
3、安装其它开发工具
3.1、安装代码比较工具
sudo apt-get install meld
3.2、
http://www.cnblogs.com/kobe8/p/3998379.html
在Ubuntu14.04上编译Android4.0.1出现的几个问题 sudo apt-get install libswitch-perl
(1)、 出错以下出错信息:
Import includes file: out/target/product/mx3/obj/STATIC_LIBRARIES/libwebcore_intermediates/import_includes
target Generated: libwebcore <= external/webkit/Source/WebCore/css/tokenizer.flex
<span style="rgb(255, 255, 51);">Can't locate Switch.pm in @INC (you may need to install the Switch module)</span> (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
make: *** [out/target/product/mx3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] Error 2
make: *** Waiting for unfinished jobs....
make: *** [out/target/product/mx3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/platform/ColorData.cpp] Error 2
target Generated: libwebcore <= external/webkit/Source/WebCore/html/parser/HTMLEntityNames.in
解决方法是安装perl的switch库:
sudo apt-get install libswitch-perl
3.3、将shell从DASH切换到BASH:
http://blog.csdn.net/smilettxp/article/details/19118057?reload
ubuntu 12.04编译MTK6582——FAQ
现象:
加载MT6582_Android_scatter.txt文件后,Flash_tool无法显示下载内容时,查看XXXX_preloader.log中有如下提示:
/bin/sh: 1: [: -a: unexpected operator
awk: line 4: function strtonum never defined
awk: line 4: function strtonum never defined
解决办法:/bin/sh: 1: [: -a: unexpected operator 分析原因为/bin/sh的链接到/bin/dash,而不是/bin/bash(可以用命令ls /bin/sh -lh查看链接的时bash还是dash)
修改sh默认指向到/bin/bash,如下:
sudo dpkg-reconfigure dash 选择no,即可。
awk:line的解决办法是安装gnu awk,如下:
sudo apt-get install gawk
将shell从DASH切换到BASH:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo dpkg-reconfigure dash
(按TAB按键选择:No)
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
Adding 'diversion of /bin/sh to /bin/sh.distrib by bash'
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash'
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ls /bin/sh -lh
lrwxrwxrwx 1 root root 4 6月 14 08:43 /bin/sh -> bash
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
┌───────────────────────────────────────────────────┤ Configuring dash ├───────────────────────────────────────────────────┐
│ │
│ The system shell is the default command interpreter for shell scripts. │
│ │
│ Using dash as the system shell will improve the system's overall performance. It does not alter the shell presented to │
│ interactive users. │
│ │
│ Use dash as the default system shell (/bin/sh)? │
│ │
│ <Yes> <No> │
│
4、安装JDK1.6:jdk-6u45-linux-x64.bin
(1)
安装JDK1.6,使用如下命令:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ cd wyb/
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$ ll
total 8
drwxrwxr-x 2 rootroot rootroot 4096 6月 14 08:50 ./
drwxr-xr-x 17 rootroot rootroot 4096 6月 14 08:50 ../
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$ ll
total 70408
drwxrwxr-x 2 rootroot rootroot 4096 6月 14 08:50 ./
drwxr-xr-x 17 rootroot rootroot 4096 6月 14 08:50 ../
-rwx------ 1 rootroot rootroot 72087592 6月 9 21:39 jdk-6u45-linux-x64.bin*
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$ sudo cp jdk-6u45-linux-x64.bin /opt
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$ cd /opt
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$ ll
total 70408
drwxr-xr-x 2 root root 4096 6月 14 08:51 ./
drwxr-xr-x 20 root root 4096 6月 13 11:55 ../
-rwx------ 1 root root 72087592 6月 14 08:51 jdk-6u45-linux-x64.bin*
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$ sudo chmod 777 jdk-6u45-linux-x64.bin
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$ ll
total 70408
drwxr-xr-x 2 root root 4096 6月 14 08:51 ./
drwxr-xr-x 20 root root 4096 6月 13 11:55 ../
-rwxrwxrwx 1 root root 72087592 6月 14 08:51 jdk-6u45-linux-x64.bin*
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$ sudo ./jdk-6u45-linux-x64.bin
(2)
设置JDK环境变量,在HOME根目录下按键盘Crtr+H显示HOME目录下所有文件,打开.bashrc,在最后加入以下代码:
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/opt$ cd ~
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ ll
total 4679564
drwxr-xr-x 17 rootroot rootroot 4096 6月 14 08:50 ./
drwxr-xr-x 4 root root 4096 6月 13 11:56 ../
-rw------- 1 rootroot rootroot 289 6月 13 12:46 .bash_history
-rw-r--r-- 1 rootroot rootroot 220 6月 13 11:56 .bash_logout
-rw-r--r-- 1 rootroot rootroot 3771 6月 13 11:56 .bashrc
drwx------ 14 rootroot rootroot 4096 6月 14 08:01 .cache/
drwxr-xr-x 13 rootroot rootroot 4096 6月 13 12:46 .config/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Desktop/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Documents/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Downloads/
drwx------ 3 rootroot rootroot 4096 6月 13 12:16 .gnupg/
drwxr-xr-x 3 rootroot rootroot 4096 6月 13 12:05 .local/
drwx------ 5 rootroot rootroot 4096 6月 14 07:45 .mozilla/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Music/
-rw-rw-r-- 1 rootroot rootroot 8977887 6月 13 12:27 my_video-1.mkv
-rw-rw-r-- 1 rootroot rootroot 35531753 6月 13 12:28 my_video-2.mkv
-rw-rw-r-- 1 rootroot rootroot 45847173 6月 13 12:35 my_video-3.mkv
-rw-rw-r-- 1 rootroot rootroot 5055327 6月 13 12:35 my_video-4.mkv
-rw-rw-r-- 1 rootroot rootroot 809570438 6月 13 12:46 my_video-5.mkv
-rw-rw-r-- 1 rootroot rootroot 3886767817 6月 14 08:53 my_video-6.mkv
drwxr-xr-x 2 rootroot rootroot 4096 6月 14 07:45 Pictures/
-rw-r--r-- 1 rootroot rootroot 807 6月 13 11:56 .profile
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Public/
-rwxrwxrwx 1 rootroot rootroot 9148 6月 14 08:13 smb.conf*
drwx------ 2 rootroot rootroot 4096 6月 13 12:16 .ssh/
-rw-r--r-- 1 rootroot rootroot 0 6月 13 12:17 .sudo_as_admin_successful
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Templates/
drwxr-xr-x 2 rootroot rootroot 4096 6月 13 12:05 Videos/
drwxrwxr-x 2 rootroot rootroot 4096 6月 14 08:50 wyb/
-rw------- 1 rootroot rootroot 154 6月 14 08:13 .Xauthority
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ cp .bashr bak1.bashrc
cp: cannot stat '.bashr': No such file or directory
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ cp .bashrc bak1.bashrc
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
在.bashrc的最后面加入:
#set java environment
export JAVA_HOME=/opt/jdk1.6.0_45
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
(3)
测试JDK是否安装成功,使用命令java -version 如果显示(需要注销,或者重启ubuntu系统)
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
则JDK安装成功。
5、可以不装的软件:
sudo apt-get install nautilus-open-terminal
sudo apt-get install mingw32
sudo apt-get install ia32-libs
sudo apt-get install lib32readline-gplv2-dev
sudo apt-get install u-boot-tools uboot-mkimage
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo apt-get install g++-4.4-multilib
sudo apt-get install gcc-4.4-multilib
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install nautilus-open-terminal
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nautilus-open-terminal
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install mingw32
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mingw32
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1
E: Package 'ia32-libs' has no installation candidate
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install lib32readline-gplv2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package lib32readline-gplv2-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'lib32readline-gplv2-dev' has no installation candidate
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install u-boot-tools uboot-mkimage
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package uboot-mkimage is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
u-boot-tools
E: Package 'uboot-mkimage' has no installation candidate
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install gcc-4.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gcc-4.4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'gcc-4.4' has no installation candidate
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install g++-4.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package g++-4.4
E: Couldn't find any package by glob 'g++-4.4'
E: Couldn't find any package by regex 'g++-4.4'
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install g++-4.4-multilib
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package g++-4.4-multilib
E: Couldn't find any package by glob 'g++-4.4-multilib'
E: Couldn't find any package by regex 'g++-4.4-multilib'
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ sudo apt-get install gcc-4.4-multilib
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-4.4-multilib
E: Couldn't find any package by glob 'gcc-4.4-multilib'
E: Couldn't find any package by regex 'gcc-4.4-multilib'
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
可选安装:
系统管理工具:
sudo apt-get install gnome-system-tools
图形界面下配置防火墙:
sudo apt-get install gufw
图形界面下配置启动服务:
sudo apt-get install bum
图形界面下配置Samba :
sudo apt-get install system-config-samba
性能监控软件:
sudo apt-get install nmon
sudo apt-get install wine(根据自己的需要可选安装)
http://www.linuxidc.com/Linux/2012-08/67433.htm
Ubuntu 12.04下安装天气指示器My Weather Indicator
安装比较慢
http://www.linuxidc.com/Linux/2012-05/60281.htm
Ubuntu下安装中国天气预报工具cnWeather
ubuntu麒麟版本自带
https://linux.cn/article-4850-1.html
在Ubuntu 14.10中如何安装和配置‘天气信息指示器’
代码生成文档工具
sudo apt-get install docbook-utils xmlto
(需要1GB+的空间,不知道有啥用?)
其他工具
sudo apt-get install exuberant-ctags
不要安装的:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
(以下4个不要安装)
sudo apt-get install gcc-4.5-arm-linux-gnueabihf
sudo apt-get install gcc-arm-linux-gnueabihf
sudo apt-get install g++-arm-linux-gnueabihf
sudo apt-get install c++-arm-linux-gnueabihf
6、编译安装Python2
https://www.jianshu.com/p/c75b370fdff0
Ubuntu编译安装Python2.7.13
必须安装:
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$ ll
total 87536
drwxrwxr-x 2 rootroot rootroot 4096 6月 14 09:05 ./
drwxr-xr-x 17 rootroot rootroot 4096 6月 14 09:57 ../
-rwx------ 1 rootroot rootroot 72087592 6月 9 21:39 jdk-6u45-linux-x64.bin*
-rwx------ 1 rootroot rootroot 17535962 6月 9 21:40 Python-2.7.17.tgz*
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$ tar zxvf Python-2.7.17.tgz
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb$ cd Python-2.7.17/
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$ ./configure
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$ make -j6
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$ sudo make install
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~/wyb/Python-2.7.17$ cd /usr/bin/
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$ ll pyth*
lrwxrwxrwx 1 root root 9 3月 13 20:31 python2 -> python2.7*
-rwxr-xr-x 1 root root 3694632 4月 7 20:05 python2.7*
lrwxrwxrwx 1 root root 9 6月 13 11:54 python3 -> python3.8*
-rwxr-xr-x 1 root root 5457536 4月 27 23:53 python3.8*
-rwxr-xr-x 1 root root 384 3月 28 10:39 python3-futurize*
-rwxr-xr-x 1 root root 388 3月 28 10:39 python3-pasteurize*
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$ sudo cp python2.7 python
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:/usr/bin$ cd ~
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$
7、编译及其步骤(请参考R系列具体的编译手册):
参考资料:
http://www.linuxidc.com/Linux/2014-04/100645.htm
Ubuntu 14.04 LTS下安装Google Chrome浏览器
http://blog.csdn.net/man_embedded/article/details/40111023
linux下编译MTK android的环境搭建
http://jingyan.baidu.com/article/624e7459abb8eb34e8ba5aa2.html
Ubuntu10.04搭建MTK android编译环境
http://blog.csdn.net/doon/article/details/8053174
ubuntu 12.04 64位设置兼容32位的实现
http://blog.csdn.net/yimiyangguang1314/article/details/39996851
Ubuntu 12.04 64bit 无法识别交叉编译器解决办法
http://pkgs.org/download/ia32-libs
ia32-libs Download (DEB)
http://source.android.com/source/initializing.html
Initializing a Build Environment
http://processors.wiki.ti.com/index.php/TI-Android-JB-4.2.2-DevKit-4.1.1_DeveloperGuide
TI-Android-JB-4.2.2-DevKit-4.1.1 DeveloperGuide
https://www.virtualbox.org/
virtualbox