LoginSignup
1
1

TOPPERS/FMPカーネルソース勉強会(0) docker, build_fmp.sh

Last updated at Posted at 2018-03-13

TOPPERSのC++のconfiguratorを使い、FMPカーネルをコンパイルするshell scriptを用意

~/workdir/scripts/build_fmp.sh

<この項は書きかけです。順次追記します。>

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

cd $HOME/workdir
wget https://releases.linaro.org/components/toolchain/binaries/7.1-2017.08/aarch64-elf/gcc-linaro-7.1.1-2017.08-x86_64_aarch64-elf.tar.xz
mkdir aarch64-elf-gcc
tar xvf gcc-linaro-7.1.1-2017.08-x86_64_aarch64-elf.tar.xz -C aarch64-elf-gcc --strip-components 1
echo 'export PATH=$HOME/workdir/aarch64-elf-gcc/bin:$PATH' > ~/.bash_profile
source ~/.bash_profile

wget http://www.toppers.jp/download.cgi/cfg-1.9.6.tar.gz
mkdir cfg-1.9.6
tar xvf cfg-1.9.6.tar.gz -C cfg-1.9.6 --strip-components 2
cd cfg-1.9.6
nkf -e -Lu --overwrite configure
./configure --with-libraries=/usr/lib/x86_64-linux-gnu/
make
cd ..
echo $PATH
# build a FMP kernel
git clone https://github.com/YujiToshinaga/RPi64Toppers.git
cd RPi64Toppers/fmp
mkdir cfg
cd cfg
mkdir cfg
cd cfg
ln -s ../../../../cfg-1.9.6/cfg/cfg cfg
cd ../../
mkdir build; cd build
perl ../configure -T rpi_arm64_gcc
make fmp.bin

exit 0

バイナリのクロスコンパイラのダウンロードと展開

wget https://releases.linaro.org/components/toolchain/binaries/7.1-2017.08/aarch64-elf/gcc-linaro-7.1.1-2017.08-x86_64_aarch64-elf.tar.xz
tar xvf gcc-linaro-7.1.1-2017.08-x86_64_aarch64-elf.tar.xz -C aarch64-elf-gcc --strip-components 1

PATHの宣言と有効化

echo 'export PATH=$HOME/workdir/aarch64-elf-gcc/bin:$PATH' > ~/.bash_profile
source ~/.bash_profile

configuratorのダウンロードと展開・構築

wget http://www.toppers.jp/download.cgi/cfg-1.9.6.tar.gz
mkdir cfg-1.9.6
tar xvf cfg-1.9.6.tar.gz -C cfg-1.9.6 --strip-components 2
cd cfg-1.9.6
nkf -e -Lu --overwrite configure
make

#Raspberry pi用toppers/fmpのダウンロード

git clone https://github.com/YujiToshinaga/RPi64Toppers.git

難解1 configuratorの置き場所

cd RPi64Toppers/fmp
mkdir cfg
cd cfg
mkdir cfg
cd cfg
ln -s ../../../../cfg-1.9.6/cfg/cfg cfg
cd ../../

configuration and make

mkdir build; cd build
perl ../configure -T rpi_arm64_gcc
make fmp.bin

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>

文書履歴(document history)

ver. 0.01 初稿  20180313
ver. 0.02 ありがとう追記 20230513

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1