跳到主要內容

網樂通編譯Kernel & modules

參考網址:
https://xiaolaba.wordpress.com/2012/10/20/ubuntu-12-10-stlinux-2-4/
http://www.twpda.com/2012/10/nextvod-compile-kernel.html
https://github.com/dlintw/kernel-pdk7105/tree/twpda

編譯環境:linuxmint-18-cinnamon-64bit


1.安裝STLinux 2.4



參考
https://xiaolaba.wordpress.com/2012/10/20/ubuntu-12-10-stlinux-2-4/

主要步驟為

下載 ISO 檔
mkdir STLinux
cd STLinux
wget ftp://ftp.stlinux.com/pub/stlinux/2.4/iso/STLinux-2.4-sh4-20121121.iso

掛載 ISO 檔
sudo mkdir /mnt/iso
sudo mount -o loop STLinux-2.4-sh4-20120822.iso /mnt/iso

安裝 STLinux
cd /mnt/iso
sudo ./installb --debian all-sh4-glibc

2.下載原始碼


cd ~/STLinux
wget https://github.com/dlintw/kernel-pdk7105/archive/twpda.zip
unzip twpda.zip


3.編譯


cd kernel-pdk7105-twpda
export PATH=$PATH:/opt/STM/STLinux-2.4/host/bin:/opt/STM/STLinux-2.4/devkit/sh4/bin
make mrproper
sh ./make.sh all



這邊整理一下我編譯出現的問題

1.build-essential 沒安裝
sudo apt-get install build-essential

2.make ARCH=sh CROSS_COMPILE=sh4-linux- menuconfig
出現ncurses問題
sudo apt-get install libncurses5-dev

3.
kernel/timeconst.h error 255
解決辦法:
將kernel/timeconst.pl中第373行的defined()去掉只留下@val就可以了

來源:
https://my.oschina.net/hanxiaodong/blog/755703

4.產生 vmlinux.ub 沒mkimage
sudo apt-get install u-boot-tools

手動產生
mkimage -A sh -O linux -T kernel -C gzip -a 0x80800000 -e 0x80801000  -n "Linux 2.6" -d vmlinux.bin.gz vmlinux.ub

Kernel 編出來的位子
arch/sh/boot/

modules 編出來的位子
lib/modules

留言

這個網誌中的熱門文章

小蟻智慧攝影機支援RTSP

來源: http://en.miui.com/thread-196713-1-1.html 小蟻智慧攝影機版本: 1.8.5.1l_201511061661(台灣版) 下載檔案 https://drive.google.com/file/d/0ByjBix7wpeJJY0ZWZXlvWl9Za1E/view?usp=sharing 把攝影機SD卡拿讀卡機讀取 把壓縮檔內的test資料夾放進SD根目錄 插回SD卡至攝影機 重開 攝影機會呈現橘燈並執行更新 等恢復至藍燈或是用app確認攝影機開啟 用VLC或相關程式讀取串流 Main stream:rtsp:// <CameraIP> :554/ch0_0.h264 Minor stream:rtsp:// <CameraIP> :554/ch0_1.h264 Audio stream:rtsp:// <CameraIP> :554/ch0_3.h264 Telnet與FTP開啟加上 # Telnet if [ ! -f "/etc/init.d/S88telnet" ]; then     echo "#!/bin/sh" > /etc/init.d/S88telnet     echo "telnetd &" >> /etc/init.d/S88telnet     chmod 755 /etc/init.d/S88telnet fi # FTP echo "#!/bin/sh" > /etc/init.d/S89ftp echo "tcpsvd -vE 0.0.0.0 21 ftpd -w / &" >> /etc/init.d/S89ftp chmod 755 /etc/init.d/S89ftp User:  root Password:  1234qwer 使用passwd改密碼 參考: http://en.miui.com/thread-224653-1-1.html

Ollama AMD GPU 支援

AMD Radeon RX 6300(gfx1034)為例 本次為官方不支援 LLVM Target 參考 ollama-for-amd 安裝ROCmLibs for HIP SDK 6.1.2 AMD HIP SDK for Windows 官方支援GPU 下載ollama https://github.com/likelovewant/ollama-for-amd/releases 執行Ollama 於資料夾執行ollama: ollama serve AMD Radeon RX 6300 為gfx1034 LLVM Target 回應不支援GPU: msg="amdgpu is not supported (supported types:[gfx1030 gfx1100 gfx1101 gfx1102 gfx906])" gpu_type=gfx1034 gpu=0 library="C:\\Program Files\\AMD\\ROCm\\6.1\\bin" 下載gfx1034 ROCm https://github.com/likelovewant/ROCmLibs-for-gfx1103-AMD780M-APU/releases/tag/v0.6.1.2 將rocblas.dll及library 備份後刪除 C:\Program Files\AMD\ROCm\6.1\bin\rocblas.dll C:\Program Files\AMD\ROCm\6.1\bin\rocblas\library 將下載後的gfx1034 ROCm解壓後放置於 C:\Program Files\AMD\ROCm\6.1\bin\rocblas.dll C:\Program Files\AMD\ROCm\6.1\bin\rocblas\library 重新執行 執行ollama: ollama serve 本次已找到適應版本 msg="inference compute" id=0 library=rocm variant="" compute=gfx1034 driver=6.1 name="AMD R