2016年12月2日 星期五

網樂通編譯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

沒有留言:

張貼留言

預測2031/1/1可能 TWCA 憑證 IOS會出現不信任

緣由: TWCA CYBER Root CA 有兩張、兩個效期 (2030、2047年到期) 推測TWCA 預計 2030年12月會停用: TWCA CYBER Root CA (2030 年到期) TWCA Global Root CA 改用啟用: TWCA CYBER ...