1. 程式人生 > >RK3188上執行Ubuntu系統

RK3188上執行Ubuntu系統

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

               

參照:http://androtab.info/radxa_rock/ubuntu/

注意事項:

1.不要使用163源,163的源上不帶 armhf架構。

2.Sdcard使用不了可以使用

u盤,這都無所謂。

3.最後啟動桌面時如果出現:

xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)

Device Drivers  --->    Character devices  --->         [*] Virtual terminal

選上Virtual terminal

。就會建立/dev/tty0

燒寫miniroot,然後設定啟動變數editenv,儲存saveenv以後就可以自動啟動Ubuntu系統了。
boot=/dev/sda1:/ubuntu
init=/sbin/init
autoboot=1

其它:
1.CONFIG_VT can fix that “xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)”
2.CONFIG_FRAMEBUFFER_CONSOLE=y (and if you want console on screen, need "console=tty0" in CMDLINE) 
可以實現Ctrl+Alt+F1/F2...實現的虛擬終端功能。


更:

Miniroot from:  http://androtab.info/radxa_rock/sdboot/

0.解打包boot.img

Unpack boot.img 兩種方法

1tail -c +9 boot.img | gzip -dc | cpio -i

2rkunpack boot.img

會生成boo.img-raw這個就是ramdisk.img

Pack boot.img 兩步

1find . | cpio -o -H newc | gzip > ../boot-new.img

2rkcrc -k boot-new.img boot.img

From: http://linux-rockchip.info/mw/index.php?title=Rkutils

 

試了RK編譯Android中的製作方法,失敗了,暫時不知道為什麼:

mkbootfs boot | minigzip > ramdisk.img && \

./mkkrnlimg ramdisk.img ramdisk-rk.img

 

1.乙太網不能使用

使用root使用者可以上網了,但是不能ping也不能使用network manager

sudo service network-manager start

ROOT使用者可以通過Firefox上網了。

(以後可以嘗試使用最新版本的核心)

不能ping似乎是因為核心版本的問題,Android核心會有點問題。

將其新增至:/etc/rc.local 問題得以解決。

 

2.關於執行速度慢的問題

燒寫到sdcard中速度比U盤快多了。

這個要仔細考慮一下是怎麼回事。USB傳輸速度沒有mmc/sd控制器輸出速度快的原因嗎?

 

3.Waiting up to 60 more seconds for network configuration...

解決方法:

/etc/init/failsafe.conf 註釋其中的sleep n。

From: https://petermolnar.eu/linux-tech-coding/ubuntu-11-10-disable-waiting-up-to-60-more-seconds-for-network-configuration/

可以實現27秒啟動。

 

3.完全執行在SDCARD

將所有韌體燒寫到sdcard中:

(1).將sdcard製作成可以啟動的boot from SD card on Radxa Rock文章中的方法(2).使用gparted分出一個區用來放Ubuntu系統,分割槽前要留40MiB容量。(3).將Ubuntu映象燒入到sdb1分割槽   sudo fsarchiver restfs fs-ubuntu-rk3188.fsa id=0,dest=/dev/sdb1$ sudo fsarchiver restfs fs-ubuntu-rk3188.fsa id=0,dest=/dev/sdb1Statistics for filesystem 0* files successfully processed:....regfiles=65939, directories=6741, symlinks=29994, hardlinks=25, specials=85* files with errors:...............regfiles=0, directories=0, symlinks=0, hardlinks=0, specials=0$(4).將環境變數設定為   root=/dev/mmcblk0p1:/ubuntu   (可通過設定miniroot預設的env)<>

4.如何備份系統

(1)製作一個指令碼燒寫 先分兩個區,再燒寫sdboot/loader/miniroot。第二個分割槽燒寫Ubuntu系統。

(2)將所有系統製作成一個韌體,通過dd命令統一燒寫。

壓縮 的 備份與還原

備份 壓縮

dd bs=1M if=/dev/sdx | gzip > backup.gz

dd bs=4M if=/dev/sdx | gzip > backup.gz

還原 解壓縮

gzip -dc backup.gz | dd of=/dev/sdx # default bs=4k

gzip -dc backup.gz | dd bs=1M of=/dev/sdx

gzip -dc backup.gz | dd bs=4M of=/dev/sdx

Fromhttp://blog.longwin.com.tw/2013/10/dd-sd-card-backup-os-2013/


5.解決非root使用者不能連線網路

Disable ANDROID_PARANOID_NETWORK
config ANDROID_PARANOID_NETWORK
        bool "Only allow certain groups to create sockets"
        default y
        help
                none
make menuconfig --->
 Networking support  --->
  Networking options  ---> 
   [*] Only allow certain groups to create sockets

From: naobsd

6.Fix Audio out put problem

1. let ubuntu join "audio" group
sudo usermod -a -G audio ubuntu

2.install pavucontrol
sudo apt-get install pavucontrol

3.enable sound card output(just need do one time, I don't know why pavucontrol can't open it)
sudo amixer cset numid=1,iface=MIXER,name='Playback Path' SPK

4.play video by smplayer/ play audio(wav/mp3/etc) by vlc。
5.about sound cards
there are two cards on rk3188. there for HDMI and machine self.
(1) ROCKCHIP-SPDIF is for HDMI.
(2) RK_RK616       is for machine self. 
you should check it to the correct out device.

then you can use pavucontrol, it works fine almostly.


已知Bugs:
1.關於休眠的兩個問題
(1)休眠喚醒後不能正常的登入
 Device Drivers  --->   
  Graphics support  --->  
   Console display driver support  --->
    Framebuffer Console support
暫時沒有解決。

(2)深度休眠後不能喚醒
暫時沒有好的方法解決。

2.音訊相關不能使用
aplay ../usr/share/sounds/purple/receive.wav 可以插入聲音。

播放:
aplay Windows.wav
調音量:
amixer controls
amixer cget numid=1
amixer cset numid=1 30

from: http://www.100ask.org/bbs/forum.php?mod=viewthread&tid=10566


3. about flash on ubuntu-arm
ref: Flash on the Raspberry Pi


4. WiFi/AP6330

prepare firmware, load driver, run supplicant or something

a. prepare firmware

[email protected]:/ $ 
[  151.508421] Current WiFi chip is AP6330.
[  151.546786] =======================================================
[  151.553398] ==== Launching Wi-Fi driver! (Powered by Rockchip) ====
[  151.560073] =======================================================
[  151.566684] RKWIFI WiFi driver (Powered by Rockchip,Ver 4.53.WFD) init.
[  151.574037] =========== WLAN placed in POWER ON ========
[  151.579728] ANDROID-ERROR) wifi_set_power = 1
[  151.584305] rk29sdk_wifi_power: 1
[  151.839625] wifi turn on power
[  151.842710] ANDROID-ERROR) wifi_set_carddetect = 1
[  151.847545] rk29sdk_wifi_set_carddetect:1
[  151.851581] mmc1: slot status change detected(0-1)
[  152.048853] 
[  152.048857] drivers/mmc/core/core.c...2010..  ===== mmc_rescan Begin....[mmc1]
[  152.092894] 
[  152.092897] mmc_attach_sdio..808..  ===== Begin to identify card as SDIO-card. [mmc1]
[  152.164637] rk29_sdmmc_change_clk_div..1961..  newDiv=0, newCLK=24000Khz [sdio]
[  152.174937] mmc1: new high speed SDIO card at address 0001
[  152.182317] sdmmc_rescan_try_freq..1886..  ===== Initialize SDIO successfully. [mmc1]
[  152.190664] Linux Kernel SDIO/MMC Driver
[  152.195295] dhdsdio_probe : no mutex held. set lock
[  152.200296] FW_PATH = /system/etc/firmware/fw_RK903_ag.bin
[  152.200318] NVRAM_PATH = /system/etc/firmware/nvram_AP6330.txt
[  152.211956] F1 signature read @0x18000000=0x16044330
[  152.220855] DHD: dongle ram size is set to 294912(orig 294912)
[  152.227318] dhd_bus_select_firmware_name_by_chip: firmware_path=/system/etc/firmware/fw_RK903_ag.bin
[  152.238244] wl_create_event_handler thr:71e created
[  152.243488] wl_create_event_handler thr:71e started
[  152.251069] p2p0: P2P Interface Registered
[  152.255589] dhd_attach thr:71f created
[  152.259738] dhd_attach thr:71f started
[  152.263766] dhd_attach thr:721 created
[  152.267721] dhd_attach thr:721 started
[  152.271740] dhd_attach thr:722 created
[  152.275731] dhd_attach thr:722 started
[  152.280003] ANDROID-ERROR) wifi_get_mac_addr
[  152.284375] bcmsdh_set_drvdata Enter
[  152.290756] Broadcom Dongle Host Driver: register interface [wlan0] MAC: 00:90:4c:11:22:33
[  152.302942] dhdsdio_probe : the lock is released.
[  152.308524] 
[  152.308533] Dongle Host Driver, version 1.28.13.1.1 (r)
[  152.308548] Compiled in drivers/net/wireless/bcmdhd on Jul  4 2013 at 10:32:45
[  152.323169] ANDROID-ERROR) wifi_set_power = 0
[  152.327767] rk29sdk_wifi_power: 0
[  152.532149] wifi shut off power
[  152.535357] =========== WLAN placed in RESET ========
[  152.543754] Current WiFi chip is AP6330.
[  152.569982] dhd_bus_select_firmware_name_by_chip: firmware_path=/system/etc/firmware/fw_RK903_ag.bin
[  152.570098] Dongle Host Driver, version 1.28.13.1.1 (r)
[  152.570114] Compiled in drivers/net/wireless/bcmdhd on Jul  4 2013 at 10:32:45
[  152.570248] wl_android_wifi_on in
[  152.570291] ANDROID-ERROR) wifi_set_power = 1
[  152.570348] rk29sdk_wifi_power: 1
[  152.821723] wifi turn on power
[  152.821833] =========== WLAN going back to live  ========
[  152.821978] sdio_reset_comm():
[  152.822079] rk29_sdmmc_change_clk_div..1961..  newDiv=40, newCLK=300Khz [sdio]
[  152.828080] rk29_sdmmc_change_clk_div..1961..  newDiv=0, newCLK=24000Khz [sdio]
[  152.828601] dhd_bus_devreset: == WLAN ON ==
[  152.828654] dhd_bus_devreset called when dongle is not in reset
[  152.828717] Will call dhd_bus_start instead
[  152.829192] F1 signature read @0x18000000=0x16044330
[  152.839570] DHD: dongle ram size is set to 294912(orig 294912)
[  152.840620] dhd_bus_select_firmware_name_by_chip: firmware_path=/system/etc/firmware/fw_RK903_ag.bin
[  153.070471] bcmsdh_set_drvdata Enter
[  153.073200] ANDROID-ERROR) wifi_get_mac_addr
[  153.085999] CFG80211-ERROR) wl_cfg80211_attach_post : p2p0: p2p_dev_addr=02:22:f4:d9:84:1f
[email protected]:/ $ 

[email protected]:/system # lsmod
wlan 458451 0 - Live 0x00000000
gps 161924 0 - Live 0x00000000
vpu_service 11717 0 - Live 0x00000000
rk29_ipp 9957 0 - Live 0x00000000 (C)
mali 112485 5 - Live 0x00000000
ump 27320 15 mali, Live 0x00000000
rk30xxnand_ko 314328 0 - Live 0x00000000
[email protected]:/system # 

b. load driver


off-topic:

Bootloader目前就使用RK官方的,反正是不支援傳輸DTS,不過也不影響學習使用DTS,核心可以自行獲取屁股後邊的DTS。
Mini2440上也可以使用DTS了,得選一個版本。基於3.10來實現DTS的研究。Ubuntu那個不再弄了。

1.Enable Device Tree Support
menuconfig -> Boot options -> Flattened Device Tree support
(CONFIG_USE_OF)

2.Enable
Use appended device tree blob to zImage (EXPERIMENTAL)
(CONFIG_ARM_APPENDED_DTB) 
這個巨集是為了相容那些還不支援將dts傳輸給核心的bootloader引導。使用CONFIG_ARM_APPENDED_DTB後你僅僅需要將dts檔案緊貼在zImage後邊,核心就可以自行載入dts。

3.編譯make zImage dtb

From:http://www.slideshare.net/nij05/device-tree-introduction



其它資料:

1.高版本的核心Linux 3.10 on Radxa RockLinux Kernel 3.17

2.從sdcard啟動boot from SD card on Radxa Rock

3.RK3188啟動流程Boot_Sequences




           

給我老師的人工智慧教程打call!http://blog.csdn.net/jiangjunshow

這裡寫圖片描述