shell
RaspberryPi
docker
SSP
TOPPERS

TOPPERS/SSPカーネルソース勉強会(0) docker, build_ssp.sh, build_ssp_ruby.sh

TOPPERSには
C++のconfigurator
Rubyのconfigurator
の2種類がある。

それぞれを使うshell scriptを用意

C++のconfigurator

~/workdir/scripts/build_ssp.sh

build_ssp.sh
#!/usr/bin/env bash
set -eu

# build a configurator
if [ ! -e cfg-1.8.0 ]; then
  if [ ! -e cfg-1.8.0.tar.gz ]; then
    curl http://www.toppers.jp/download.cgi/cfg-1.8.0.tar.gz -o cfg-1.8.0.tar.gz
  fi
  mkdir cfg-1.8.0
  tar xvf cfg-1.8.0.tar.gz -C cfg-1.8.0 --strip-components 2
fi

cd cfg-1.8.0
./configure --with-libraries=/usr/lib/x86_64-linux-gnu/
make
cd ..

# build a SSP kernel
if [ ! -e ssp ]; then
  if [ ! -e ssp-1.3.0.tar.gz ]; then
    curl http://www.toppers.jp/download.cgi/ssp-1.3.0.tar.gz -o ssp-1.3.0.tar.gz
  fi
  tar xvf ssp-1.3.0.tar.gz
fi

cd ssp
ln -s ../cfg-1.8.0 cfg

mkdir build; cd build
perl ../configure -T cq_frk_fm3_gcc
make depend
make

exit 0

rubyのconfigurator

build_ssp_ruby.sh
#!/usr/bin/env bash
set -eu

if [ ! -e asp3 ]; then
  if [ ! -e asp3-3.1.0.tar.gz ]; then
    curl https://www.toppers.jp/download.cgi/asp3-3.1.0.tar.gz -o asp3-3.1.0.tar.gz
  fi
  tar xvf asp3-3.1.0.tar.gz
fi

if [ ! -e ssp_ruby ]; then
  if [ ! -e ssp-1.3.0.tar.gz ]; then
    curl http://www.toppers.jp/download.cgi/ssp-1.3.0.tar.gz -o ssp-1.3.0.tar.gz
  fi
  mkdir ssp_ruby
  tar xvf ssp-1.3.0.tar.gz -C ssp_ruby --strip-components 2
fi

for i in `find ssp_ruby -type f` ; do nkf --overwrite --oc=UTF-8 $i; done
cp -a asp3/sample/Makefile ssp_ruby/sample

svn co http://dev.toppers.jp/svn_user/contrib/rubycfg_ssp/trunk rubycfg_ssp
rubycfg_ssp/install.sh ssp_ruby

cd ssp_ruby
ln -s ../asp3/configure.rb configure.rb
ln -s ../asp3/cfg cfg

# build a kernel with the ruby configurator 
mkdir build
cd build
../configure.rb -T cq_frk_fm3_gcc -w
make

exit 0

setup

./scripts/setup_user.sh
#!/usr/bin/env bash

set -eu

echo export LANG=ja_JP.UTF-8 >> ${HOME}/.profile
echo export LANGUAGE=ja_JP:ja >> ${HOME}/.profile
echo LV="-Au8" >> ${HOME}/.profile
cat << EOS >> ${HOME}/.vimrc
:set fenc=utf-8
:set fencs=iso-2022-jp,euc-jp,cp932,utf-8
:set enc=utf-8
EOS

exit 0