728x90

출처

Python 3.7 설치

Python을 설치하기 전에 Python을 빌드하는 데 필요한 필수 패키지를 설치

X
user@localhost:~

[user@localhost]$ sudo apt update
[user@localhost]$ sudo apt install -y --no-install-recommends libbluetooth-dev tk-dev uuid-dev wget ca-certificates gnupg2 dirmngr python python3 gcc build-essential wget zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev

Python 소스 다운로드

X
user@localhost:~

[user@localhost]$ PYTHON_VERSION=3.7.7
[user@localhost]$ wget "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"

Python 빌드

X
user@localhost:~

[user@localhost]$ tar -xvf Python-3.7.7.tar.xz
[user@localhost]$ cd Python-3.7.7/
[user@localhost]$ sudo ./configure --enable-loadable-sqlite-extensions \
  --enable-optimizations \
  --enable-option-checking=fatal \
  --enable-shared \
  --with-system-expat \
  --with-system-ffi \
  --without-ensurepip
[user@localhost]$ sudo make -j 2 PROFILE_TASK='-m test.regrtest --pgo \
  test_array test_base64 test_binascii test_binhex test_binop test_bytes test_c_locale_coercion \
  test_class test_cmath test_codecs test_compile test_complex test_csv test_decimal test_dict \
  test_float test_fstring test_hashlib test_io test_iter test_json test_long test_math test_memoryview \
  test_pickle test_re test_set test_slice test_struct test_threading test_time test_traceback test_unicode'
 
 ... 생략 ...
 
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2                  _dbm                  _lzma              
_sqlite3                                                       
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
 
 
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc                  atexit                pwd                
time                                                           
 
running build_scripts
copying and adjusting /home/pi/Python-3.7.7/Tools/scripts/pydoc3 -> build/scripts-3.7
copying and adjusting /home/pi/Python-3.7.7/Tools/scripts/idle3 -> build/scripts-3.7
copying and adjusting /home/pi/Python-3.7.7/Tools/scripts/2to3 -> build/scripts-3.7
copying and adjusting /home/pi/Python-3.7.7/Tools/scripts/pyvenv -> build/scripts-3.7
changing mode of build/scripts-3.7/pydoc3 from 644 to 755
changing mode of build/scripts-3.7/idle3 from 644 to 755
changing mode of build/scripts-3.7/2to3 from 644 to 755
changing mode of build/scripts-3.7/pyvenv from 644 to 755
renaming build/scripts-3.7/pydoc3 to build/scripts-3.7/pydoc3.7
renaming build/scripts-3.7/idle3 to build/scripts-3.7/idle3.7
renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7
renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7
make[1]: Leaving directory '/home/pi/Python-3.7.7'

Python 3.7 설치

X
user@localhost:~

[user@localhost]$ sudo make install
[user@localhost]$ sudo ldconfig
[user@localhost]$ sudo find /usr/local -depth \
  \( \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
  -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \) -exec rm -rf '{}' +
[user@localhost]$ python3 --version
[user@localhost]$ cd /usr/local/bin \
  && sudo ln -s idle3 idle \
  && sudo ln -s pydoc3 pydoc \
  && sudo ln -s python3 python \
  && sudo ln -s python3-config python-config

pip 설치

X
user@localhost:~

[user@localhost]$ cd ~
[user@localhost]$ wget -O get-pip.py "https://github.com/pypa/get-pip/raw/d59197a3c169cef378a22428a3fa99d33e080a5d/get-pip.py";
[user@localhost]$ sudo python3 get-pip.py --disable-pip-version-check --no-cache-dir "pip==20.0.2"

설치 확인

X
user@localhost:~

[user@localhost]$ python3 --version
Python 3.7.7
[user@localhost]$ pip3 --version
pip 20.0.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

728x90
728x90

출처

고정 IP 설정

X
user@localhost:~

[user@localhost]$ sudo vi /etc/network/interfaces


auto eth0
#       iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.200
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 219.250.36.130

서비스 다시 시작

X
user@localhost:~

[user@localhost]$ sudo systemctl restart networking.service
[user@localhost]$ sudo systemctl status networking.service
[0m networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: active (exited) since Sun 2017-08-27 13:26:01 CST; 30min ago
     Docs: man:interfaces(5)
  Process: 14900 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=0/SUCCESS)
  Process: 14956 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
  Process: 14952 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-envi
 Main PID: 14956 (code=exited, status=0/SUCCESS)
 
Aug 27 13:26:00 bpi-iot-ros-ai systemd[1]: Starting Raise network interfaces...
Aug 27 13:26:01 bpi-iot-ros-ai systemd[1]: Started Raise network interfaces.

DNS 설정

X
user@localhost:~

[user@localhost]$ sudo vi /etc/resolv.conf


nameserver 219.250.36.130

glmark2 설치

X
user@localhost:~

[user@localhost]$ sudo apt-get install git g++ build-essential pkg-config
[user@localhost]$ sudo apt-get install libx11-dev libgl1-mesa-dev
[user@localhost]$ sudo apt-get install libjpeg-dev libpng-dev
[user@localhost]$ cd ~/
[user@localhost]$ git clone https://github.com/glmark2/glmark2.git
[user@localhost]$ cd glmark2/
[user@localhost]$ ./waf configure --with-flavors=x11-gl
[user@localhost]$ ./waf build -j 4
[user@localhost]$ sudo ./waf install

lsmod

X
user@localhost:~

[user@localhost]$ lsmod
Module                  Size  Used by
hci_uart               18784  1
bcmdhd                565499  0
ft5x_ts                58051  0
ov5640                 41452  0
vfe_v4l2              175612  0
option                 29049  0
usb_wwan                5308  1 option
vfe_io                 28241  2 vfe_v4l2,ov5640
videobuf2_dma_contig     8494  1 vfe_v4l2
videobuf2_memops        1276  1 videobuf2_dma_contig
ss                     30684  0
videobuf2_core         22619  1 vfe_v4l2
ip_tables               9635  0
x_tables               12243  1 ip_tables

sunxi-mali 빌드 (실패)

X
user@localhost:~

[user@localhost]$ git clone --recursive https://github.com/linux-sunxi/sunxi-mali.git
[user@localhost]$ cd sunxi-mali
[user@localhost]$ make config
rm -f config.mk
make config.mk
make[1]: Entering directory '/home/pi/sunxi-mali'
make -f Makefile.config
make[2]: Entering directory '/home/pi/sunxi-mali'
ABI="armhf" (Detected)
Error: Failed to open /dev/mali: No such file or directory
VERSION="" (Detected)
Error: Failed to open /dev/mali: No such file or directory
Error: Failed to open /dev/mali: No such file or directory
Error: Failed to open /dev/mali: No such file or directory
Error: Failed to open /dev/mali: No such file or directory
Error: Failed to open /dev/mali: No such file or directory
Makefile.config:57: Unknown/unhandled Mali Version ""
Makefile.config:58: Use VERSION=(r2p4,r3p0,r3p1,r3p2-01rel1) instead
Error: Failed to open /dev/mali: No such file or directory
Makefile.config:59: *** Unknown/unhandled Mali Version "".  Stop.
make[2]: Leaving directory '/home/pi/sunxi-mali'
Makefile:12: recipe for target 'config.mk' failed
make[1]: *** [config.mk] Error 2
make[1]: Leaving directory '/home/pi/sunxi-mali'
Makefile:8: recipe for target 'config' failed
make: *** [config] Error 2
pi@bpi-iot-ros-ai:~/sunxi-mali$ dpkg -l | grep libump
pi@bpi-iot-ros-ai:~/sunxi-mali$ ls
include  lib  Makefile  Makefile.config  Makefile.setup  README  test  version

libump 빌드

출처 : GitHub - linux-sunxi/libump: Unified Memory Provider userspace API source code needed for xf86-video-mali compilation

X
user@localhost:~

[user@localhost]$ git clone https://github.com/linux-sunxi/libump.git
[user@localhost]$ cd libump
[user@localhost]$ autoreconf -i
[user@localhost]$ ./configuremake
[user@localhost]$ make
[user@localhost]$ sudo make install

dpkg-buildpackage

X
user@localhost:~

[user@localhost]$ sudo apt-get install debhelper dh-virtualenv
[user@localhost]$ sudo dpkg-buildpackage -b
dpkg-buildpackage: info: source package libump
dpkg-buildpackage: info: source version 3.0-0sunxi1
dpkg-buildpackage: info: source distribution any
dpkg-buildpackage: info: source changed by Luc Verhaegen 
dpkg-buildpackage: info: host architecture armhf
 dpkg-source --before-build libump
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 9) dh-autoreconf
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)

libdri2 빌드

출처 : Mali binary driver - linux-sunxi.org

X
user@localhost:~

[user@localhost]$ sudo apt-get install xutils-dev
git clone https://github.com/robclark/libdri2
cd libdri2
./autogen.sh
./configure --prefix=/usr
make
make install
ldconfig

sunxi-mali 빌드(성공)

버전 찾기

X
user@localhost:~

[user@localhost]$ sudo find / -name libUMP.so -print
/home/pi/sunxi-mali/lib/mali/r3p0/armel/android/libUMP.so

make config

X
user@localhost:~

[user@localhost]$ cd sunxi-mali
[user@localhost]$ make config VERSION=r3p0 ABI=armhf
rm -f config.mk
make config.mk
make[1]: Entering directory '/home/pi/sunxi-mali'
make -f Makefile.config
make[2]: Entering directory '/home/pi/sunxi-mali'
ABI="armhf" (Provided)
VERSION="r3p0" (Provided)
EGL_TYPE="x11" (Detected)
echo "MALI_VERSION ?= r3p0" > config.mk
echo "MALI_LIBS_ABI ?= armhf" >> config.mk
echo "MALI_EGL_TYPE ?= x11" >> config.mk
make[2]: Leaving directory '/home/pi/sunxi-mali'
make[1]: Leaving directory '/home/pi/sunxi-mali'

sunxi-mali 설치

X
user@localhost:~

[user@localhost]$ sudo make install
make -C lib install
make[1]: Entering directory '/home/pi/sunxi-mali/lib'
make -C mali install
make[2]: Entering directory '/home/pi/sunxi-mali/lib/mali'
make -C r3p0/armhf/x11/
make[3]: Entering directory '/home/pi/sunxi-mali/lib/mali/r3p0/armhf/x11'
install -m 644 libMali.so //usr/lib/
rm -f //usr/lib/libEGL.so.1.4 //usr/lib/libEGL.so.1 //usr/lib/libEGL.so
ln -sf libMali.so //usr/lib/libEGL.so.1.4
ln -sf libEGL.so.1.4 //usr/lib/libEGL.so.1
ln -sf libEGL.so.1 //usr/lib/libEGL.so
rm -f //usr/lib/libGLESv1_CM.so.1.1 //usr/lib/libGLESv1_CM.so.1 //usr/lib/libGLESv1_CM.so
ln -sf libMali.so //usr/lib/libGLESv1_CM.so.1.1
ln -sf libGLESv1_CM.so.1.1 //usr/lib/libGLESv1_CM.so.1
ln -sf libGLESv1_CM.so.1 //usr/lib/libGLESv1_CM.so
rm -f //usr/lib/libGLESv2.so.2.0 //usr/lib/libGLESv2.so.2 //usr/lib/libGLESv2.so
ln -sf libMali.so //usr/lib/libGLESv2.so.2.0
ln -sf libGLESv2.so.2.0 //usr/lib/libGLESv2.so.2
ln -sf libGLESv2.so.2 //usr/lib/libGLESv2.so
make[3]: Leaving directory '/home/pi/sunxi-mali/lib/mali/r3p0/armhf/x11'
make[2]: Leaving directory '/home/pi/sunxi-mali/lib/mali'
make[1]: Leaving directory '/home/pi/sunxi-mali/lib'
make -C include install
make[1]: Entering directory '/home/pi/sunxi-mali/include'
mkdir -p //usr//include/EGL
install -m 644 EGL/egl.h EGL/eglext.h //usr//include/EGL
mkdir -p //usr//include/EGL
install -m 644 EGL/eglplatform.h //usr//include/EGL/eglplatform.h
mkdir -p //usr//include/GLES
install -m 644 GLES/gl.h GLES/glext.h GLES/glplatform.h //usr//include/GLES
mkdir -p //usr//include/GLES2
install -m 644 GLES2/gl2.h GLES2/gl2ext.h GLES2/gl2platform.h //usr//include/GLES2
mkdir -p //usr//include/KHR
install -m 644 KHR/khrplatform.h //usr//include/KHR
make[1]: Leaving directory '/home/pi/sunxi-mali/include'

test

X
user@localhost:~

[user@localhost]$ make test
cc -Wall -o test test.c -lEGL -lGLESv2

xf86-video-fbturbo 설치

X
user@localhost:~

[user@localhost]$ sudo apt-get install xorg-dev
[user@localhost]$ git clone https://github.com/ssvb/xf86-video-fbturbo.git
[user@localhost]$ cd xf86-video-fbturbo
[user@localhost]$ autoreconf -vi
[user@localhost]$ ./configure --prefix=/usr
[user@localhost]$ make
[user@localhost]$ sudo make install

xorg.conf 복사

X
user@localhost:~

[user@localhost]$ sudo cp xorg.conf /etc/X11/xorg.conf

BLE

X
user@localhost:~

[user@localhost]$ sudo hcitool lescan
LE Scan ...
57:12:AD:C3:6C:D6 (unknown)
40:D8:1D:AC:2E:42 (unknown)
57:12:AD:C3:6C:D6 [LG] webOS UHD Box AN-US800K
62:83:F6:7E:66:EF (unknown)
62:83:F6:7E:66:EF (unknown)

728x90

+ Recent posts