标签:compiler default oss 体验 开关 port device host log
$ls
HISTORY.rst NOTICE requests/ setup.cfg
LICENSE PKG-INFO requests.egg-info/ setup.py*
MANIFEST.in README.rst requirements.txt test_requests.py*
#!/bin/bash
export CC=arm-none-linux-gnueabi-gcc
../zlib-1.2.11/configure \
--prefix=`pwd`
AR=arm-none-linux-gnueabi-ar
RANLIB=arm-none-linux-gnueabi-ranlib
#!/bin/bash
../Python-3.6.0/configure \
--host=arm-none-linux-gnueabi \
--build=armv7 \
--prefix=`pwd` \
--enable-ipv6 \
--enable-shared \
ac_cv_file__dev_ptmx="yes" \
ac_cv_file__dev_ptc="no" \
LDFLAGS="-L/home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Termcap/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/lib"\
CPPFLAGS="-I/home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/include \
-I/home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/include \
-I/home/pengdonglin/disk_ext/Third_Part/Termcap/aarch32/include \
-I/home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/include"\
LDLAST="-L/home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Termcap/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/lib"
make -j4
make install
#!/bin/bash
../Python-2.7.13/configure --prefix=`pwd` \
--host=arm-none-linux-gnueabi \
--build=x86_64-linux-gnu \
--enable-ipv6 \
--enable-shared \
ac_cv_file__dev_ptmx="yes" \
ac_cv_file__dev_ptc="no" \
LDFLAGS="-L/home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Termcap/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/lib"\
CPPFLAGS="-I/home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/include \
-I/home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/include \
-I/home/pengdonglin/disk_ext/Third_Part/Termcap/aarch32/include \
-I/home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/include"\
LDLAST="-L/home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Termcap/aarch32/lib \
-L/home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/lib"\
#!/bin/bash
make HOSTPYTHON=../x86_64/python \
HOSTPGEN=../x86_64/Parser/pgen \
BLDSHARED="arm-none-linux-gnueabi-gcc -shared" \
CROSS_COMPILE=arm-none-linux-gnueabi- \
CROSS_COMPILE_TARGET=yes \
HOSTARCH=arm-none-linux-gnueabi \
BUILDARCH=x86_64-linux-gnu \
-j4
#!/bin/bash
make install HOSTPYTHON=../x86_64/python \
BLDSHARED="arm-none-linux-gnueabi-gcc -shared" \
CROSS_COMPILE=arm-none-linux-gnueabi- \
CROSS_COMPILE_TARGET=yes \
prefix=`pwd`
#!/bin/bash
thiry_part=/home/pengdonglin/disk_ext/Third_Part/
cross_compile=/home/pengdonglin/disk_ext/Cross_Compiler/aarch32/
sudo rm -rf rootfs
sudo rm -rf tmpfs
sudo rm -rf ramdisk*
sudo losetup -d /dev/loop0
sudo losetup /dev/loop0 ./fs_vexpress_1G.img
sudo partprobe /dev/loop0
sudo mkdir rootfs
sudo cp ${thiry_part}/Busybox/aarch32/_install/* rootfs/ -raf
sudo mkdir -p rootfs/proc/
sudo mkdir -p rootfs/sys/
sudo mkdir -p rootfs/tmp/
sudo mkdir -p rootfs/root/
sudo mkdir -p rootfs/var/
sudo mkdir -p rootfs/mnt/
sudo cp etc rootfs/ -arf
sudo cp -arf ${cross_compile}/arm-2014.05/arm-none-linux-gnueabi/libc/lib rootfs/
#Python3
sudo mkdir -p rootfs/usr
pushd rootfs/usr
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python3/aarch32/bin .
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python3/aarch32/lib .
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python3/aarch32/include .
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python3/aarch32/share .
#Python2
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python2/aarch32/bin .
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python2/aarch32/lib .
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python2/aarch32/include .
sudo cp -raf /home/pengdonglin/disk_ext/Python/Python2/aarch32/share .
popd
#SQlite3
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/bin/* rootfs/bin/
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/include/* rootfs/include/
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/lib/* rootfs/lib/
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/SQlite3/aarch32/share/* rootfs/usr/share
#Readline
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/include/ rootfs/include/
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/Readline/aarch32/lib/* rootfs/lib/
#Zlib
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/include/* rootfs/include/
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/Zlib/aarch32/lib/* rootfs/lib/
#BeautifulSoup4
sudo cp -raf /home/pengdonglin/disk_ext/Python/BeautifulSoup4/beautifulsoup4-4.5.3/bs4 rootfs/usr/lib/python2.7/site-packages
sudo cp -raf /home/pengdonglin/disk_ext/Python/BeautifulSoup4/beautifulsoup4-4.5.3/py3k/bs4 rootfs/usr/lib/python3.6/site-packages
#Requests
sudo cp -raf /home/pengdonglin/disk_ext/Python/Requests/requests-2.3.0/requests rootfs/usr/lib/python2.7/site-packages
sudo cp -raf /home/pengdonglin/disk_ext/Python/Requests/requests-2.3.0/requests rootfs/usr/lib/python3.6/site-packages
#Boa
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/WebServer/Boa/boa-0.94.13/src/boa rootfs/bin
sudo mkdir -p rootfs/usr/lib/boa
sudo cp -raf /home/pengdonglin/disk_ext/Third_Part/WebServer/Boa/boa-0.94.13/src/boa_indexer rootfs/usr/lib/boa
sudo mkdir -p rootfs/var/www/cgi-bin
sudo mkdir -p rootfs/var/log/boa
sudo rm -rf rootfs/lib/*.a
sudo arm-none-linux-gnueabi-strip rootfs/lib/* rootfs/bin/*
sudo arm-none-linux-gnueabi-strip rootfs/usr/lib/boa/*
sudo arm-none-linux-gnueabi-strip rootfs/usr/lib/*
sudo arm-none-linux-gnueabi-strip rootfs/usr/bin/*
sudo arm-none-linux-gnueabi-strip rootfs/bin/*
sudo mkdir -p rootfs/dev/
sudo mknod rootfs/dev/tty1 c 4 1
sudo mknod rootfs/dev/tty2 c 4 2
sudo mknod rootfs/dev/tty3 c 4 3
sudo mknod rootfs/dev/tty4 c 4 4
sudo mknod rootfs/dev/console c 5 1
sudo mknod rootfs/dev/null c 1 3
sudo mkdir ./tmpfs/
sudo mount -t ext4 /dev/loop0p1 ./tmpfs/
sudo rm -rf ./tmpfs/*
sudo cp -raf rootfs/* ./tmpfs/
sleep 2
sudo umount ./tmpfs/
sudo losetup -d /dev/loop0
[root@vexpress ]# python3
Python 3.6.0 (default, May 6 2017, 00:08:14)
[GCC 4.8.3 20140320 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>>
[root@vexpress ]# python2
Python 2.7.13 (default, May 6 2017, 00:11:41)
[GCC 4.8.3 20140320 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>>
#!/usr/bin/env python2
import requests
import time
apiurl = "http://api.yeelink.net/v1.0/device/7445/sensor/405914/datapoints"
apiheaders = {‘U-ApiKey‘:‘3957bd54eaddd2fda1f35841d52776d9‘}
while True:
r = requests.get(apiurl, headers=apiheaders)
print(r.text)
sw = r.json()
if sw[‘value‘] == 1:
print("Switch On")
elif sw[‘value‘] == 0:
print("Switch Off")
time.sleep(2)
#!/usr/bin/env python3
import requests
import time
apiurl = "http://api.yeelink.net/v1.0/device/7445/sensor/405914/datapoints"
apiheaders = {‘U-ApiKey‘:‘3957bd54eaddd2fda1f35841d52776d9‘}
while True:
r = requests.get(apiurl, headers=apiheaders)
print(r.text)
sw = r.json()
if sw[‘value‘] == 1:
print("Switch On")
elif sw[‘value‘] == 0:
print("Switch Off")
time.sleep(2)
标签:compiler default oss 体验 开关 port device host log
原文地址:http://www.cnblogs.com/pengdonglin137/p/6817085.html