LoginSignup
0
0

More than 1 year has passed since last update.

BastilleBSDでLinux環境

Last updated at Posted at 2021-06-04

BastilleBSDを使ってjail自体をLinux環境(LinuxJails)にする事もできるようです。私の場合、gccなどのツールが動けばよい事と、Linuxのコマンドに不慣れなのでバイナリ互換機能(Linuxulator)の方が便利です。

普通のLinuxバイナリ互換のjailを作ってみます。

% sudo bastille create c7jail 13.0-RELEASE 192.168.10.51
% sudo bastille template c7jail develop/setup
% sudo bastille pkg c7jail install linux_base-c7

以前はlinux_base-c6を使っていましたが13Rではc6は無くなったようなのでc7にしてみました。

ホストのrc.confでlinux_enable="YES"しておけばこれで完了です。

% sudo bastille console c7jail hiroki
> file mips-linux-gcc
mips-linux-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.2.5, stripped
> ./mips-linux-gcc -v
Using built-in specs.
Target: mips-linux
Configured with: RSDK Builder release 1.5
Thread model: posix
gcc version 4.4.5-1.5.5p4 (GCC) 

newlib-2.5.0.20171222をコンパイルしてみました。

OS CPU TIME
FreeBSD Core i5-460M 2.53GHz/2コア/4スレッド 64bit(Arrandale) 701秒
Debian Celeron D 335J 2.8GHz/1コア/1スレッド 32bit(Prescott) 2400秒

CPUのスペックがまったく違うので比較になりませんが目安です。

newlibはパラレルビルドに対応しているようで、Core i5でj8を付けてnewlib-3.0.0.20180831をビルドしたところ389秒でした。newlibはconfigureがいろいろ使われていて、これはシングルで実行しているようなので、4スレッドでも半分以下にならないのかもしれません。

ホストではLinuxバイナリ互換を使わない場合はrc.confにlinux_mounts_enable="NO"を入れておくと良いです。

Linuxのプログラムでprocfsを使用している場合は、bastille editでmount.procfsを追加しておく必要がありました。

0
0
1

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
0
0