Skip to content

Commit 7b49aa7

Browse files
committed
add ubuntu20.04 environment support
1 parent ac5062c commit 7b49aa7

File tree

8 files changed

+183
-8
lines changed

8 files changed

+183
-8
lines changed

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Object files
5+
*.o
6+
*.ko
7+
*.obj
8+
*.elf
9+
10+
# Linker output
11+
*.ilk
12+
*.map
13+
*.exp
14+
15+
# Precompiled Headers
16+
*.gch
17+
*.pch
18+
19+
# Libraries
20+
*.lib
21+
*.a
22+
*.la
23+
*.lo
24+
25+
# Shared objects (inc. Windows DLLs)
26+
*.dll
27+
*.so
28+
*.so.*
29+
*.dylib
30+
31+
# Executables
32+
*.exe
33+
*.out
34+
*.app
35+
*.i*86
36+
*.x86_64
37+
*.hex
38+
39+
# Debug files
40+
*.dSYM/
41+
*.su
42+
*.idb
43+
*.pdb
44+
45+
# Kernel Module Compile Results
46+
*.mod*
47+
*.cmd
48+
.tmp_versions/
49+
modules.order
50+
Module.symvers
51+
Mkfile.old
52+
dkms.conf

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
[TOC]
44

5-
**Config environment can refer this document [envoirnment setup](./doc/Setup-develop-environment.md)**
5+
**Config environment using Fedora32 can refer this document [envoirnment setup](./doc/Setup-develop-environment.md)**
6+
7+
**for ubuntu20.04, refer this [setup4ubuntu20.04](./doc/Setup-develop-environment_ubuntu20.04.md)**
68

79
## **support architecture now**
810

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# setup develop enviromment for ubuntu20.04
2+
3+
## preinstall
4+
5+
```shell
6+
sudo apt install build-essential
7+
sudo apt install bison
8+
sudo apt install flex
9+
sudo apt-get install gconf2
10+
sudo apt install net-tools
11+
sudo apt-get install bridge-utils
12+
sudo apt-get install uml-utilities
13+
sudo apt-get install libncurses5-dev libncursesw5-dev
14+
```
15+
16+
## qemu install
17+
18+
```shell
19+
sudo apt install qemu
20+
sudo apt install qemu-system
21+
```
22+
23+
## toolchain install
24+
25+
```shell
26+
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz
27+
sudo tar xvf gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz -C /opt
28+
```
29+
30+
- **environment variables set**
31+
32+
`sudo vim /etc/profile`
33+
34+
add `PATH=$PATH:/opt/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin` at tail
35+
36+
- **test toolchain**
37+
38+
```shell
39+
source /etc/profile`
40+
arm-none-linux-gnueabihf-gcc --version
41+
```
42+
43+
if output as below, succeed:
44+
45+
> arm-none-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025
46+
47+
## network setting
48+
49+
```shell
50+
sudo brctl addbr br0
51+
sudo tunctl -u develop -t tap0
52+
sudo brctl addif br0 tap0
53+
sudo ifconfig tap0 192.168.1.111 promisc up
54+
sudo ifconfig ens33 192.168.1.200 promisc up
55+
```
56+
57+
## NFS config
58+
59+
```shell
60+
sudo apt-get install nfs-kernel-server
61+
vim /etc/exports
62+
append /home/develop/develop/v-kernel-qemu/rootfs 192.168.1.100(ro,no_root_squash,sync,nohide)
63+
sudo service nfs-kernel-server restart
64+
showmount -e
65+
```
66+
67+
in the qemu linux client:
68+
69+
```shell
70+
ifconfig eth0 192.168.1.123 promisc up
71+
mount -t nfs -o nolock 192.168.1.111:/home/develop/develop/v-kernel-qemu/rootfs /mnt
72+
```
73+
74+
## fixed error
75+
76+
* **libtinfo.so.5**
77+
78+
> ./debug uboot
79+
> arm-none-linux-gnueabihf-gdb: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
80+
81+
**fixed:**
82+
83+
```shell
84+
ls -la /lib/x86_64-linux-gnu/libtinfo.so.*
85+
lrwxrwxrwx 1 root root 15 May 12 07:00 /lib/x86_64-linux-gnu/libtinfo.so.6 -> libtinfo.so.6.2
86+
-rw-r--r-- 1 root root 192032 Feb 25 23:14 /lib/x86_64-linux-gnu/libtinfo.so.6.2
87+
```
88+
89+
`sudo ln -s /lib/x86_64-linux-gnu/libtinfo.so.6.2 /lib/x86_64-linux-gnu/libtinfo.so.5`
90+
91+
* **libncursesw.so.5**
92+
93+
> arm-none-linux-gnueabihf-gdb: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
94+
95+
**fixed:**
96+
97+
```shell
98+
develop@ubuntu:~/develop/v-kernel-qemu/shell$ ls -la /lib/x86_64-linux-gnu/libncursesw.*
99+
lrwxrwxrwx 1 root root 18 May 12 07:00 /lib/x86_64-linux-gnu/libncursesw.so.6 -> libncursesw.so.6.2
100+
-rw-r--r-- 1 root root 231504 Feb 25 23:14 /lib/x86_64-linux-gnu/libncursesw.so.6.2
101+
```
102+
103+
`sudo ln -s /lib/x86_64-linux-gnu/libncursesw.so.6.2 /lib/x86_64-linux-gnu/libncursesw.so.5`
104+
105+
* **python2.7**
106+
107+
> arm-none-linux-gnueabihf-gdb: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or director
108+
109+
```shell
110+
sudo apt-get install python2.7
111+
sudo apt-get install libpython2.7
112+
```
113+

shell/debug

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
source ./global.mk
4+
35
if [ 0 = $# ]; then
46
echo ""
57
echo "usage:"
@@ -11,9 +13,9 @@ fi
1113

1214
if [ 1 = $# ]; then
1315
if [ $1 = "uboot" ]; then
14-
arm-none-linux-gnueabihf-gdb -tui -x uboot_arm_gdbinit
16+
arm-none-linux-gnueabihf-gdb -tui -x ./uboot_arm_gdbinit
1517
fi
1618
if [ $1 = "kernel" ]; then
17-
arm-none-linux-gnueabihf-gdb -tui -x kernel_arm_gdbinit
19+
arm-none-linux-gnueabihf-gdb -tui -x ./kernel_arm_gdbinit
1820
fi
1921
fi

shell/kernel_arm_gdbinit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
file /home/develop/vexpress-a9/src/linux-5.6.11/vmlinux
1+
file ../src/linux-5.6.11/vmlinux
22
target remote 127.0.0.1:1234

shell/rootfs_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414
# 1.先进行清理操作
1515
sudo rm -rf rootfs
1616
sudo rm -rf tmpfs
17-
17+
sudo mkdir images
1818
sudo mkdir rootfs
1919
# 2.创建Linux中的必要文件夹
2020
sudo mkdir -p rootfs/bin # /bin包含普通用户和超级用户都能使用的命令
@@ -58,5 +58,5 @@ sudo mount -t ext3 rootfs.ext3 tmpfs/ -o loop
5858
# 8.将之前创建的文件系统相关的文件放到通过tmpfs放到rootfs.ext3文件系统中去
5959
sudo cp -r rootfs/* tmpfs/
6060
sudo umount tmpfs
61-
mv rootfs.ext3 $IMAGE_DIR
61+
sudo mv rootfs.ext3 $IMAGE_DIR
6262
sudo rm -rf tmpfs

shell/setup_net4ubuntu20.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
sudo brctl addbr br0
3+
sudo tunctl -u develop -t tap0
4+
sudo ifconfig tap0 192.168.1.111 promisc up
5+
sudo ifconfig ens33 192.168.1.100 promisc up

shell/uboot_arm_gdbinit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
target remote 127.0.0.1:1234
2-
file /home/develop/vexpress-a9/src/u-boot-2020.04/u-boot
1+
#!/bin/bash
2+
target remote 127.0.0.1:1234
3+
file ../src/u-boot-2020.04/u-boot

0 commit comments

Comments
 (0)