2012/10/14

inside nextvod - cross compile

[2013/12/29 updated]

Build Cross Compile Environment

Cross compile under ArchLinux, there are three methods at least:
  1. virtualbox + debian + Neo's method (OK)
  2. chroot debian + install STLinux in ubuntu (Both STLinux 2.3 and 2.4)
    • Build debian chroot Environment, ref this link.
      • yaourt -S debootstrap
      • debootstrap --arch i386 squeeze /opt/debian http://ftp.tw.debian.org/debian # i386 OK, amd64 failed
    • setup sshd and automatic startup
    • ssh localhost  -p <port> # enter your chroot environment
    • Prepare related STLinux 2.3/2.4 packages
      • sudo apt-get install rpm python-urlgrabber python-rpm python-sqlitecachec python-libxml2
    • Install STLinux 2.3
      • wget http://www.stlinux.com/sites/default/files/stlinux23-host-STLinux_deps-0.1-5.i386.rpm
      • wget http://www.stlinux.com/sites/default/files/stlinux23-host-STLinux_deps-0.1-5.i386.rpm
      • sudo rpm -ivh stlinux23-host-STLinux_deps-0.1-5.i386.rpm
      • wget http://ftp.stlinux.com/pub/stlinux/2.3/install # ref:doc
      • stlinux_23_install_patch.sh # modify the old install script
    • Install STLinux 2.4
      • wget http://ftp.stlinux.com/pub/stlinux/2.4/misc/stlinux24-host-STLinux_deps-20131122-1.i386.rpm find newest
      • sudo rpm -ivh --force-debian  stlinux24-host-STLinux_deps-20131122-1.i386.rpm
      • wget http://ftp.stlinux.com/pub/stlinux/2.4/install
    • Start to install
      • sudo bash ./install -d all-sh4-glibc
      • add /opt/STM/STLinux-2.4/devkit/sh4/bin /opt/STM/STLinux-2.4/host/bin/ to path
      • sudo apt-get install make gcc libncurses-dev  # for build busybox
      • sudo apt-get install unzip  # for build kernel
      • try sh4-linux-gcc
    • Update to newest version
      • apt-get update ; apt-get dist-upgrade # for debian
      • stmyum update # for STLinux
3. crosstool-ng (build hello.c OK, but can not build nextvod's kernel)
    • Downgrade to make 3.81automake 1.11
    • ct-ng help
    • ct-ng list-samples
    • ct-ng sh4-unknown-linux-gnu
    • ct-ng build
Uninstall method:
  • wget http://ftp.stlinux.com/pub/stlinux/2.3/uninstall
  • bash ./uninstall -d -a sh4 -i 2.3 --force

沒有留言: