QUSIR


  • Startseite

  • Archiv

我对灯光的各种印象

Veröffentlicht am 2017-03-12

 记得小时候晚上提供的光源是黄色光的那种灯泡,没电的时候用蜡烛或是油灯。那时候的科技还没有现在那么发达,再加上是农村,没有后面发白光的灯管和LED。每个夜晚给我留下的回忆是昏黄色的,跟白色的光芒差很远,可看不太清楚,在那种光的照耀下事物也变成了黄色,给我的感觉不是很好。记得小时候喜欢吃甜食,弄得牙齿不好,经常牙痛。当时我缓解牙痛的办法就是哭,毕竟那个时候的我对疼痛忍耐力有限,再加上在哭的过程中,引起奶奶关心,会弄些蜜糖水给我喝,哭过之后疼痛也逐渐消去。但眼中的泪水还停留在眼角,哭的时候我常对着那黄色的灯泡,调节自己眼睛张开距离来控制我眼角中的泪珠。使那黄色的光芒透过那泪珠产生的折射现象。这时我眼中的那枚灯泡光线四散,像是闪亮的星星,觉得好玩好看。还有一种可能是我小时候哭多了的缘故,最终导致我眼睛下面多了一颗眼泪痣。
 随着科技发展,那种发黄色光的灯泡比较少用了,随即而来的是灯管,发出白色的光芒。它的那种光跟白天的太阳光并不会差很远,它可以将事物照得很清楚。对于这种灯光我是比较渴望的,这种渴望是我初中那个时候产生的。由于初中时候需要大量时间学习,也就需要光,追赶着别人。夜自习时间总是感觉太短,回到宿舍又会关灯,且是那种黄色灯泡,看不清楚。为了花更多时间在学习上,经常去快班借光学习。因为其他的班都在晚自习下课之后都关灯,而快班还留有一盏灯管。那时的我渴望自己能够在那白色光芒之下学习,上进的我。
 还有一种灯光会带来一种温暖,是那种建筑工地专用高瓦数的照明小灯管。看上去它的体积并没有那种家用灯管那么大,但它发出的光芒比家用灯管要耀眼。由于父亲是装修工人的缘故。自己也时常会呆在工地,玩或是帮忙。每当他加班赶工的时候开启那种灯,天气冷的时候我会靠近那盏灯。它散发出的光之中有股温暖,可能是功率高的缘故,那光以热量形式散发出来。

armbian定制教程

Veröffentlicht am 2017-02-14

##时间201702141045

##官方网站

https://www.armbian.com/

可以下载相应板子对应的镜像

view

###下载源码,定制系统生成相对应镜像

mkdir armbian
apt-get -y install git
git clone https://github.com/igorpecovnik/lib --depth 1
cp lib/compile.sh .

开启代理,不然会生成失败,需要下载相应文件,服务器在国外会比较慢,或是被墙住了

生成指令
./compile.sh KERNEL_CONFIGURE=yes

生成过程中选择相对应板子选项,然后再output/image/目录下生成相对应文件,然后将该文件烧入SD卡内。

##官方文档
https://docs.armbian.com/

orangePi源码编译教程

Veröffentlicht am 2017-02-14

#环境
ubuntu 12.04.5 64位 8G内存
jdk-6u45-linux-x64.bin 64位JDK6
板子是 orangePC pc
如果内存不够会编译不成功,安装好jdk6配置好环境变量

jdk网盘下载链接 密码:jkei

#linux源码编译
下载源码压缩包

网址http://www.orangepi.org/downloadresources/

###解压源码
tar -xzvf h3-lichee-1.0.tar.gz
解压出 lichee目录,进入该目录

buildroot: 工程编译脚本
brandy: boot,uboot 源码以及开源交叉编译工具 gcc-linaro
linux-3.4: 内核源码
tools: 工程编译工具
build.sh: 编译脚本

###执行编译指令
在lichee目录执行以下指令

$ ./build.sh configA

选择
此时系统会提示芯片的选择,对于 OrangePi PC ,选择 sun8iw7p1

此时系统会提示平台的选择,对于 OrangePi PC,选择 dragonboard

此时系统会调试板子的选择,对于 OrangePi PC,选择 dolphin-p1

编译成功后会如下显示

view

###内核镜像文件和库的替换
编译完成之后,将会目录下生成如下文件:

boot: /lichee/tools/pack/chips/sun8iw7p1/bin/boot0_sdcard_sun8iw7p1.bin

uboot: /lichee/tools/pack/chips/sun8iw7p1/bin/u-boot-sun8iw7p1.bin

uImage: /lichee/out/sun8iw7p1/dragonboard/common/uImage

libs: /lichee/linux-3.4/output/lib/modules

将以上生成文件替换原有系统目录下相应的文件

源码网盘下载地址

百度网盘链接 密码:lh9l

#android源码编译

android源码链接 密码:9zsj

makefile文件链接 密码:x9ov

###安装相应软件包
$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386

$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

###解压源码
创建目录
mkdir H3
移动文件
mv H3-homlet-1.0.tar.gz ./H3
解压
tar -xzvf H3-homlet-1.0.tar.gz
解压完之后会得到两个目录

android lichee

###lichee源码编译

$ cd lichee
$ ./build.sh lunch

view

编译成功后打印信息

view

###android代码编译

$ cd android
$ source ./build/envsetup.sh
$ lunch dolphin_fvd_p1-eng #选择方案号
$ extract-bsp #拷贝内核及驱动模块

由于源码解压出来没有makefile文件,需要将makefile文件拷到目录下才能执行make命令

$ make –j8 #后面的数值为同时编译的进程,依赖于主机的配置
$ pack #打包生成固件

view

编译hikey bootloader

Veröffentlicht am 2017-01-21

##交叉编译工具链:

##下载:
http://releases.linaro.org/15.02/components/toolch…
http://releases.linaro.org/15.02/components/toolch…

##安装:
mkdir arm-tc arm64-tc
tar –strip-components=1 -C ${PWD}/arm-tc -xf gcc-linaro-4.9--x86_64_aarch64-linux-gnu.tar.xz
tar –strip-components=1 -C ${PWD}/arm64-tc -xf gcc-linaro-4.9-
-x86_64_arm-linux-gnueabihf.tar.xz
export PATH=”${PWD}/arm-tc/bin:${PWD}/arm64-tc/bin:$PATH”

##bootloader代码下载:
git clone -b hikey –depth 1 https://github.com/96boards/edk2.git linaro-edk2
git clone -b hikey –depth 1 https://github.com/96boards-hikey/arm-trusted-firmware.git
git clone -b hikey –depth 1 https://github.com/96boards/LinaroPkg.git
git clone –depth 1 https://github.com/96boards/l-loader.git
git clone git://git.linaro.org/uefi/uefi-tools.git

##编译UEFI
export AARCH64_TOOLCHAIN=GCC49
export EDK2_DIR=${PWD}/linaro-edk2
export UEFI_TOOLS_DIR=${PWD}/uefi-tools

cd ${EDK2_DIR}
${UEFI_TOOLS_DIR}/uefi-build.sh -c ../LinaroPkg/platforms.config -b RELEASE -a ../arm-trusted-firmware hikey

cd ../l-loader
ln -s ${EDK2_DIR}/Build/HiKey/RELEASE_GCC49/FV/bl1.bin
ln -s ${EDK2_DIR}/Build/HiKey/RELEASE_GCC49/FV/fip.bin
arm-linux-gnueabihf-gcc -c -o start.o start.S
arm-linux-gnueabihf-gcc -c -o debug.o debug.S
arm-linux-gnueabihf-ld -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o debug.o -o loader
arm-linux-gnueabihf-objcopy -O binary loader temp
python gen_loader.py -o l-loader.bin --img_loader=temp --img_bl1=bl1.bin
sudo PTABLE=aosp-8g bash -x generate_ptable.sh
python gen_loader.py -o ptable-aosp-8g.img --img_prm_ptable=prm_ptable.img

##镜像输出(l-loader目录下):
fip.bin l-loader.bin ptable-aosp-8g.img

##烧写
sudo python hisi-idt.py –img1=l-loader.bin -d /dev/ttyUSB0
sudo fastboot flash ptable ptable-aosp-8g.img
sudo fastboot flash fastboot fip.bin

注意:
这里编译的boot_fat.uefi.img要和上面编译的fip.bin一起烧写,否则无法启动

如果不想烧写上面编译的fip.bin的话则需要手动修改生成boot_fat.uefi.img:
手动打包过程如下(将你自己编译的内核,DT和RAMDISK替换进去下面下载的prebuild的boot_fat.uefi.img后就可以了):

wget http://builds.96boards.org/releases/reference-plat...
wget https://builds.96boards.org/snapshots/reference-pl... -O grubaa64.efi
mkdir boot-fat
dd if=/dev/zero of=boot-fat.uefi.img bs=512 count=131072
sudo mkfs.fat -n "BOOT IMG" boot-fat.uefi.img
sudo mount -o loop,rw,sync boot-fat.uefi.img boot-fat
sudo cp hi6220-hikey.dtb boot-fat/hi6220-hikey.dtb
sudo cp AndroidFastbootApp.efi boot-fat/fastboot.efi
sudo cp grubaa64.efi boot-fat/grubaa64.efi
sudo umount boot-fat
sudo mv boot-fat.uefi.img hikey-boot-linux-VERSION.uefi.img
rm -rf boot-fat

##出错 fatal error: uuid/uuid.h: No such file or directory

解决

 sudo apt-get install uuid-dev

hikey替换android内核

Veröffentlicht am 2017-01-21

##配置编译器
mkdir ~/arm64-tc

###输入如下命令下载编译需要用到的组件压缩包
wget https://releases.linaro.org/14.09/components/toolchain/binaries/
gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz

###然后输入如下命令解压上面下载的压缩包

tar --strip-components=1 -C ~/arm64-tc -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz

###然后设置环境变量

export PATH=~/arm64-tc/bin:$PATH

##目前有两种版本选择,一种为Landing Team版本,另外一种为Reference Platform Build版本

##下载Landing Team版本内核源码
git clone https://github.com/96boards/linux.git

然后输入如下命令检出最新内核版本15.11 

cd linux
git checkout -b working-hikey 96boards-hikey-15.11

##如果使用Reference Platform Build版本内核源码,输入如下命令下载

git clone https://github.com/rsalveti/linux.git

然后输入如下命令检出最新内核 

git checkout reference-hikey-rebase

##最后输入如下命令开始编译内核

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export LOCALVERSION="-linaro-hikey"
make distclean 
make defconfig 
make -j8 Image modules hi6220-hikey.dtb 2>&1 | tee build-log.txt

##使用以下命令编译内核模块

export PWD=`pwd`
export INSTALL_MOD_PATH="$PWD/installed-modules"
mkdir $INSTALL_MOD_PATH
make -j8 modules_install

生成如下文件

arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb
arch/arm64/boot/Image-dtb

复制到前面新建的目录下面,即AOSP的/kernel/hikey-linaro目录。

确保我们此时的环境是HiKey的编译环境,即

$ source build/envsetup.sh 
$ lunch hikey-userdebug

最后,编译boot.img文件

$ make bootimage -j4

这一步时间很短,我花了13S就完成了。

其实会生成2个文件,即
/out/target/product/hikey/boot.img
和
/out/target/product/hikey/ramdisk.img
刷机

有了前面编译AOSP并且刷机的经验,这一过程就比较简单了。

根据使用HiKey进行开发里所说的,我们首先关机状态下将j15的跳线5-6闭合。然后开机进入fastboot模式。

然后将设备连接至虚拟机,可以使用如下命令查看设备是否已连接:

$ fastboot devices

连接上之后,我们只刷boot分区,命令如下(假定你在AOSP根目录)

fastboot flash boot out/target/product/hikey/boot.img

大约不到2s,刷机完成。

##问题与解决

刷机完成之后,开机进入系统,发现Kernel version的信息和之前的没有变化。也就是说我们刚才刷入的依然是Google prebuilt的kernel。

首先我对比了新生成的boot.img文件和之前的boot.img文件(幸好虚拟机有备份),发现md5一模一样,也就是说并没有生成新的boot.img文件。

回想之前编译完成kernel之后,要手动复制2个文件到指定目录(hi6220-hikey.dtb和Image-dtb)。在AOSP根目录使用find命令搜索这两个文件,发现除了out目录和我们前边创建的/kernel/hikey-linaro目录外,在下面的目录还有这两个文件

/device/linaro/hikey-kernel

其实这个目录里的文件就是Google prebuilt的kernel文件。
我们将前边编译生成的hi6220-hikey.dtb和Image-dtb文件复制到上面的目录中(你可以将原来的文件备份到一个新建的目录里边以防止刷编译的kernel失败之后可以快速切换回来)。

然后,我们再重新执行上面的编译boot.img文件步骤,生成新的boot.img文件。
由于前面的失败经历,这次长了个心眼,将新老boot.img文件的md5对比了一下,发现确实不一样。

真正编译成功后我们再执行前面的刷机步骤,开机之后发现Kernel version的信息确实变了:

hikey android源码编译

Veröffentlicht am 2017-01-21

##同步源码
repo init -u https://android.googlesource.com/platform/manifest -b master

repo sync -j24

##下载相应驱动

wget https://dl.google.com/dl/android/aosp/linaro-hikey-20160226-67c37b1a.tgz

tar xzf linaro-hikey-20160226-67c37b1a.tgz

./extract-linaro-hikey.sh

##编译源码
. ./build/envsetup.sh

lunch hikey-userdebug

make -j32

同步codeaurora Android源码

Veröffentlicht am 2017-01-21

##说明
codeaurora没有被墙

##源码目录

https://source.codeaurora.org/quic/la/

##官网
https://www.codeaurora.org/

##高通源码

https://wiki.codeaurora.org/xwiki/bin/QAEP/release

##初始化
repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.BR.1.2.3-10210-8x09.0.xml –repo-url=git://codeaurora.org/tools/repo.git –repo-branch=caf-stable

说明:参数LA.BR.1.2.3-10210-8x09.0.xml可以通过https://wiki.codeaurora.org/xwiki/bin/QAEP/release获得

##同步

repo sync -j16

烧写poky生成镜像

Veröffentlicht am 2017-01-21

sudo dd if= rpi-hwup-image-raspberrypi0-20170117030238.rootfsrpi-sdimg of=/dev/sdc bs=4M oflag=sync status=noxfer

说明
rpi-hwup-image-raspberrypi0-20170117030238.rootfsrpi-sdimg为生成镜像

/dev/sdc
为SD卡路径

烧写完成之后
要用串口看调试,因为很多东西没有安装配置,无法输出到显示,默认账号root 没有密码

raspbian更新内核

Veröffentlicht am 2017-01-21

##获取升级所需源码

###1)下载地址:

官方网址:raspberrypi

firmware:树莓派的交叉编译好的二进制内核、模块、库、bootloader

linux:内核源码

tools:编译内核和其他源码所需的工具——交叉编译器等

我们只需要以上三个文件即可,下面的工程可以了解一下

documentation:树莓派离线帮助文档,教你如何使用、部署树莓派(树莓派官方使用教程)

userland:arm端用户空间的一些应用库的源码——vc视频硬浮点、EGL、mmal、openVG等

hats:Hardware Attached on Top,树莓派 B+型板子的扩展板资料

maynard:一个gtk写成的桌面环境

scratch:一个简易、可视化编程环境

noobs:一个树莓派镜像管理工具,他可以让你在一个树莓派上部署多个镜像

weston:一个应用程序

target_fs:树莓派最小文件系统,使用busybox制作

quake3:雷神之锤3有线开发源码firmwareb

点到所需要下载的工程,左上角选版本,右方有一个download ZIP按钮可直接下载(笔者下载完成后,在Linux中解压提示出错,windows又非常慢切内核建议不要在windows环境解压,所以笔者不建议使用这种办法)

##使用Git下载
$ mkdir raspeberrypi_src
$ cd raspberrypi_src
$ git clone git://github.com/raspberrypi/firmware.git
$ git clone git://github.com/raspberrypi/linux.git
$ git clone git://github.com/raspberrypi/tools.git

会得到三个文件夹:
firmware linux tools

##编译、提取内核及其模块

###获得内核配置文件
在运行的树莓派中运行:

$ls /proc/

可看到一个叫config.gz的文件,他是当前的树莓派配置选项记录文件,我们将他拷出,放入我们的内核源码目录树下

$cp /proc/config /home/pi

我们这里使用前面交过的samba拷出并拷入内核源码目录下,不熟悉的人可参考前面文章

在linux内核源码下执行:

$zcat config.gz > .config

##配置、编译内核

###修改内核源码makefile ARCH类型和编译器路径
$vi Makefile +195
找到以上类似代码,改为

ARCH        ?= arm
CROSS_COMPILE    ?= ../tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-

###查看、修改配置选项
$make menuconfig

如果不做修改,直接选中exit即可(注意使用键盘操作)

###编译内核镜像
$make
在arch/arm/boot目录下可以看到一个叫zImage的文件,就是我们新的内核

但是树莓派需要另外一种格式的镜像,需要进行处理一下,执行以下命令

$cd tools/mkimage

$./imagetool-uncompressed.py ../../linux/arch/arm/boot/zImage

即可在当前文件夹下看到一个叫:kernel.img的文件,就是我们需要的新内核了

###提取modules
上一步其实不但编译出来了内核的源码,一些模块文件也编译出来了,这里我们提取一下

$cd raspberrypi_src
$mkdir modules
$cd linux
$ make modules_install INSTALL_MOD_PATH=../modules

即可在modules得到我们需要的模块文件

##升级RPi的kernel、Firmware、lib
将SD卡拔下插在电脑上(可使用读卡器)

###升级内核
将新编好的内核拷入SD卡,改名为:kernel_new.img
打开boot目录下
找到config.txt文件,加入:kernel=kernel_new.img这一行

###升级boot
将firmware/boot/目录下 以下文件拷入SD卡boot目录:fbootcode.bin fixup.dat fixup_cd.dat start.elf

###更新vc库及内核modules
编译出来的modules/lib/modules拷入树莓派文件系统/lib下

poky raspbian开发

Veröffentlicht am 2017-01-21

##安基本包

Ubuntu and Debian

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm

Fedora

$ sudo dnf install gawk make wget tar bzip2 gzip python3 unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
findutils which SDL-devel xterm

OpenSUSE

$ sudo zypper install python gcc gcc-c++ git chrpath make wget python-xml \
diffstat makeinfo python-curses patch socat libSDL-devel xterm

CentOS

$ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue SDL-devel xterm

##同步poky源代码
git clone https://git.yoctoproject.org/git/poky
进入poky目录同步树莓派代码

git clone https://git.yoctoproject.org/git/meta-raspberrypi

##初始化环境
source oe-init-build-env raspberrypi

说明:指定目录raspberrypi

##编辑配置文件

vim ./conf/local.conf 

将

MACHINE ??= "raspberrypi2"

注释

#PACKAGECONFIG_append_pn-qemu-native = " sdl"
#PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
#ASSUME_PROVIDED += "libsdl-native"

文件末尾增加
GPU_MEN = “16”

说明:16为CPU核数

vim ./conf/bblayers.conf

修改成以下

BBLAYERS ?= " \
  /home/gsta/liang/poky/meta \
  /home/gsta/liang/poky/meta-yocto \
  /home/gsta/liang/poky/meta-yocto-bsp \
  /home/gsta/liang/poky/meta-raspberrypi \
  "
##增加树莓派目录
BBLAYERS_NON_REMOVABLE ?= " \
  /home/gsta/liang/poky/meta \
  /home/gsta/liang/poky/meta-yocto \
  "

##生成
bitbake rpi-basic-image

注意:同步过程很漫长,同步过程中一定要开启git代理和终端代理

整个同步下来大概有18G

##错误处理

bitbake complains if run as root

root@eb4b9143265d:/work/build-test01# bitbake -k core-image-sato
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Do not use Bitbake as root.
ERROR: Execution of event handler 'check_sanity_eventhandler' failed
ERROR: Command execution failed: Exited with 1

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
root@eb4b9143265d:/work/build-test01#
Workaround:

$ touch conf/sanity.conf
1…3456

我思,故我在!

58 Artikel
© 2018 我思,故我在!
Erstellt mit Hexo
|
Theme — NexT.Muse v5.1.4