- The added line is THIS COLOR.
- The deleted line is THIS COLOR.
#author("2023-12-23T01:50:39+09:00;2023-12-21T09:01:37+09:00","default:kaw","kaw")
#author("2025-03-25T01:22:48+09:00;2025-03-24T12:21:31+09:00","default:kaw","kaw")
#navi(FuguItaGuide)
This chapter provides information for understanding the internals of FuguIta and for doing your own development based on FuguIta.
#contents
* FuguIta technical information [#s90159e2]
FuguIta is based on OpenBSD, so most of its components are openBSD-related information. ~
For the specific parts of FuguIta that are different from the official OpenBSD, please refer to [[List of published documents>FuguIta#ebug_doc]] on the Japan Post top page of this site. ~
(Please note that some past materials may differ from the current FuguIta.)
FuguIta source code can be found at https://github.com/ykaw/FuguIta.
* Make FuguIta a dedicated machine [#pbeaebe1]
FuguIta has all writable files in memory, so even if the power is suddenly turned off without performing a shutdown operation, etc., there will be no problem with the file system. ~
Unless you save files with usbfadm during operation, the system will start up in the same state each time.
Using these characteristics, you can create a dedicated machine (Turn Key System) to run a specific application based on FuguIta.
To build such a system, we use a combination of the techniques described so far;
- First prepare the operational environment. ~
Start up with startup mode 0, perform various settings, install applications, etc., and build the environment to perform the desired operation.
-[[Usbfadm saves the built environment to a USB memory etc.>fge2:usbfadm_sync]].
-[[Set the noasks file to start in mode 3 and start up in the saved environment>fge3:autorun]].
- Edit the [[/etc/ttys>man:ttys.5]] file to launch the application without login.
These detailed procedures can be found on this site [[Creating a router with Fuguita - Example of making an appliance>EBUG勉強会/20221126_NSHonFuguIta]] and [[Practically used FuguIta>EBUG勉強会/20140507_実用で使う河豚板]] to use.
#aname(build_fuguita)
*Build FuguIta LiveDVD [#k4da0e7c]
We publish the tools we use to build the FuguIta live system, albeit irregularly.
This section explains the steps to build a FuguIta ISO image file.
This explanation assumes the following environment.
-Release: OpenBSD 7.4
-Platform: amd64
In other cases, please read the explanation as appropriate.
**Work procedure [#k69118a9]
All operations are performed with root privileges.
***Preparing the build environment [#a324287d]
-Please follow the OpenBSD online manual [[release(8)>man:release.8]] to build the entire OpenBSD.
-Also, use [[ports(7)>man:ports.7]] to create a package for rsync, rlwrap, and pv commands.
[[Download >FuguIta/Download]] the FuguIta build tool '''tools-7.4.tar.gz''' and extract it.
# tar xvzpf tools-7.4.tar.gz
Move to the top directory of the build tools.
# cd tools-7.4
For arm64 platform, please also download '''sysmedia-7.4-arm64.img.gz''', which is supplied with tools-7.4.tar.gz, and place it in the top directory of the build tool ''without extracting it''.
Execute the following command to initialize the build tool.
# make init
This will create the files and directories needed for the build.
*** Build FuguIta [#ja0ec8b4]
Copy the installation set (*74.tgz) generated by building OpenBSD to the install_sets directory of FuguIta build tool.
# cp RELDIR/*74.tgz install_sets
'''RELDIR''' is the directory where generated release sets are stored, as described in [[release(8)>man:release.8]].
>''[Memo]''~
''⇒'' You can customize FuguIta by placing a file called '''site74.tgz''' under install_sets. This customization method complies with OpenBSD's https://www.openbsd.org/faq/faq4.html#site . ~
If '''install.site''' is included in site74.tgz, its contents will be added to /etc/rc.firsttime. ~
Please note that if the file sysmedia/fuguita-7.4-amd64.ffsimg exceeds 2GB as a result of building FuguIta by adding site74.tgz, the ISO image will not be created correctly.
Copy rsync, rlwrap, and pv created from the ports tree to the install_pkgs directory. ~
I also install rsync and pv in the build environment itself.
# cp /usr/ports/packages/amd64/all/rsync-*.tgz install_pkgs
# cp /usr/ports/packages/amd64/all/rlwrap-*.tgz install_pkgs
# cp /usr/ports/packages/amd64/all/pv-*.tgz install_pkgs
# pkg_add -D unsigned /usr/ports/packages/amd64/all/rsync-*.tgz
# pkg_add -D unsigned /usr/ports/packages/amd64/all/pv-*.tgz
>''[Memo]''~
''⇒''You can also download and use the installation set *74.tgz and package files rsync-*.tgz, etc. from the official OpenBSD mirror. ~
However, in this case, FuguIta created will be based on OpenBSD at the time the release was made public, so no later patches have been applied.~
Also, even if you create FuguIta using this method, you need to extract the OpenBSD source code under /usr/src or /usr/xenocara.
Next, run the following command to set up the build environment.
# make setup
Finally, build FuguIta LiveDVD.
# make
***post-build adjustments [#o056da6d]
''create mode0symlinks.cpio.gz''
This file is intended to save time when starting LiveDVD in mode 0 (even if this file is not present, there is no problem in starting FuguIta itself).
To create mode0symlinks.cpio.gz, boot the completed LiveDVD in mode 0 and run the gen_mode0sldir command as root with root privileges. After execution, a file called '''/etc/fuguita/mode0symlinks.cpio.gz''' will be created.
Place this file in the build tool's lib directory with the file name mode0symlinks.cpio.gz.amd64 and rerun make to create an ISO file containing mode0symlinks.cpio.gz.
''adjust fuguita_sys_mb''
FuguIta has a file called '''/etc/fuguita/global.conf''', which contains settings related to the entire system as shown below.
fuguita_sys_mb=1042 # size of sysmedia.img
newdrive_defswap=16M # default swap size at usbfadm newdrive
memfstype=mfs # 'mfs' or 'tmpfs'
mfs_max_mb=30720 # mfs hard limit - 30GB
Among these, fuguita_sys_mb defines the size of the partition that stores the FuguIta system, and this value is used when remastering FuguIta LiveUSB.
The setting value of fuguita_sys_mb corresponds to the size of the livecd.iso file generated when building a LiveDVD, but it is safe to leave about 10MB in consideration of updates using the fiupdate utility.
# echo $(( $(wc -c < livecd.iso)/1024/1024+10 ))
Write the values displayed by this command to the lib/global.conf.amd64 file and rerun make.
#aname(livedvd_remaster)
///*LiveDVDのリマスタリング [#q529c858]
///[[USBメモリの容量に合わせてLiveUSBを作成する>fge3:liveusb_remaster]]ではLiveUSBのイメージファイルを作成しましたが、この節ではremaster_dvd.shコマンドを用いて稼動中のFuguItaからLiveDVDのISOイメージを作成する方法を説明します。
///[[USBメモリの容量に合わせてLiveUSBを作成する>fge3:liveusb_remaster]]ではLiveUSBのイメージファイルを作成しましたが、この節ではremaster_dvdコマンドを用いて稼動中のFuguItaからLiveDVDのISOイメージを作成する方法を説明します。
///>''【メモ】''~
///''⇒''この作業は大きなサイズのファイルを扱うので、mfsのサイズは2ギガバイト以上必要です。~
///mfsでは足りない場合、他の記録デバイスをマウントしてそちらで作業します。
///
///このmaster_dvd.shは、動作中のFuguIta LiveDVD、あるいはFuguIta LiveUSBのどちらでも使用可能です。~
///以下にremaster_dvd.shの使用例を示します。
///以下にremaster_dvdの使用例を示します。
///
///まず、作業用ディレクトリを作成し、sysmedia以下にあるLiveDVD/LiveUSBのコンテンツをコピーします。
*LiveDVD remastering [#p3436b45]
[[Creating a LiveUSB according to the capacity of the USB memory>fge3:liveusb_remaster]] created a LiveUSB image file. Describes how to create an image.
>''[Memo]''~
''⇒''Since this operation deals with large size files, the size of mfs must be more than 2 gigabytes. ~
If mfs isn't enough, mount another recording device and work there.
This master_dvd.sh can be used with either a working FuguIta LiveDVD or FuguIta LiveUSB. ~
Below is an example of using remaster_dvd.sh.
Below is an example of using remaster_dvd.
First, create a working directory and copy the contents of LiveDVD/LiveUSB under sysmedia.
fugu-demo# mkdir work
fugu-demo# cd work
fugu-demo# cp -av /sysmedia .
/sysmedia -> ./sysmedia
/sysmedia/boot -> ./sysmedia/boot
/sysmedia/bsd-fi -> ./sysmedia/bsd-fi
/sysmedia/bsd-fi.mp -> ./sysmedia/bsd-fi.mp
/sysmedia/boot.catalog -> ./sysmedia/boot.catalog
/sysmedia/cdboot -> ./sysmedia/cdboot
/sysmedia/cdbr -> ./sysmedia/cdbr
/sysmedia/etc -> ./sysmedia/etc
/sysmedia/etc/boot.conf -> ./sysmedia/etc/boot.conf
/sysmedia/etc/random.seed -> ./sysmedia/etc/random.seed
/sysmedia/fuguita-6.9-amd64.ffsimg -> ./sysmedia/fuguita-6.9-amd64.ffsimg
fugu-demo# ls -l
total 8
drwxr-xr-x 3 root wheel 432 May 11 09:21 sysmedia
Run remaster_dvd.sh inside the copied sysmedia directory.
Run remaster_dvd inside the copied sysmedia directory.
Basically that's all.
fugu-demo# cd sysmedia
fugu-demo# ls -l
total 2008728
-rw-r--r-- 1 root wheel 90496 May 10 20:57 boot
-rwxr--r-- 1 root wheel 2048 May 9 12:31 boot.catalog
-rw-r--r-- 1 root wheel 10273019 May 10 21:04 bsd-fi
-rw-r--r-- 1 root wheel 10302063 May 10 21:04 bsd-fi.mp
-rw-r--r-- 1 root bin 91668 May 10 01:31 cdboot
-rw-r--r-- 1 root bin 2048 May 10 01:31 cdbr
drwxr-xr-x 2 root wheel 96 Apr 17 2014 etc
-rw-r--r-- 1 root wheel 1007681536 May 10 21:08 fuguita-6.9-amd64.ffsimg
fugu-demo# remaster_dvd.sh
fugu-demo# remaster_dvd
mkhybrid 1.12b5.1
Scanning .
Scanning ./etc
Size of boot image is 4 sectors -> No-emulation CD boot sector
Total translation table size: 0
Total rockridge attributes bytes: 1111
Total directory bytes: 2048
Path table size(bytes): 22
502200 extents written (980 Mb)
After executing remaster_dvd.sh, an ISO image file will be created in the working directory.
After executing remaster_dvd, an ISO image file will be created in the working directory.
fugu-demo# ls -l ..
total 2008808
-rw-r--r-- 1 root wheel 1028505600 May 14 02:34 FuguIta-6.9-amd64-202105141.iso
drwxr-xr-x 3 root wheel 384 May 14 02:34 sysmedia
fugu-demo# ls -l
total 2008720
-rw-r--r-- 1 root wheel 90496 May 10 20:57 boot
-rwxr--r-- 1 root wheel 2048 May 14 02:34 boot.catalog
-rw-r--r-- 1 root wheel 10273019 May 10 21:04 bsd-fi
-rw-r--r-- 1 root wheel 10302063 May 10 21:04 bsd-fi.mp
-rw-r--r-- 1 root bin 91668 May 10 01:31 cdboot
-rw-r--r-- 1 root bin 2048 May 10 01:31 cdbr
drwxr-xr-x 2 root wheel 96 Apr 17 2014 etc
-rw-r--r-- 1 root wheel 1007681536 May 10 21:08 fuguita-6.9-amd64.ffsimg
///sysmedia中にfuguita-6.9-amd64.ffsimgというファイルがありますが、この中にFuguItaのファイルツリーが格納されています。
///このファイルツリー内のファイルを修正することで、LiveDVDをカスタマイズすることができます。
There is a file called fuguita-6.9-amd64.ffsimg in sysmedia, which contains the FuguIta file tree.
You can customize your LiveDVD by modifying the files in this file tree.
fugu-demo# vnconfig vnd0 fuguita-6.9-amd64.ffsimg
fugu-demo# mount /dev/vnd0a /mnt
fugu-demo# ls -l /mnt
total 52
-rw-r--r-- 1 root wheel 578 May 7 17:43 .cshrc
-rw-r--r-- 1 root wheel 468 May 7 17:43 .profile
drwxr-xr-x 2 root wheel 512 May 7 17:43 altroot
drwxr-xr-x 2 root wheel 1024 May 7 17:46 bin
drwxr-xr-x 2 root wheel 512 May 8 04:16 dev
drwxr-xr-x 23 root wheel 1536 May 8 04:35 etc
drwxr-xr-x 2 root wheel 512 May 7 17:43 home
drwxr-xr-x 2 root wheel 512 May 7 17:43 mnt
drwx------ 3 root wheel 512 May 8 04:35 root
drwxr-xr-x 2 root wheel 1536 May 7 17:46 sbin
lrwxrwx--- 1 root wheel 11 May 7 17:43 sys -> usr/src/sys
drwxrwxrwt 2 root wheel 512 May 8 04:19 tmp
drwxr-xr-x 14 root wheel 512 May 8 04:09 usr
drwxr-xr-x 23 root wheel 512 May 7 17:43 var
.... (Customization work) ...
Once customization is complete, close the filesystem image and remaster.
fugu-demo# umount /mnt
fugu-demo# vnconfig -u vnd0
fugu-demo# remaster_dvd.sh
fugu-demo# remaster_dvd
mkhybrid 1.12b5.1
Scanning .
Scanning ./etc
:
:
* LiveUSB disk image remastering [#x2f9919d]
This section introduces how to create a LiveUSB disk image file.
Run usbfadm newdrive:
? : ? ->newdrive
Please make sure the device inserted.
Then press ENTER ->
==== disk(s) and vnode devices ============================
sd0 at scsibus1 targ 0 lun 0: <ATA, Hitachi HTS72757, JF4O>
sd0: 715404MB, 512 bytes/sector, 1465149168 sectors
sd1 at scsibus2 targ 1 lun 0: <UFD 3.0, Silicon-Power32G, 1.00>
sd1: 29624MB, 512 bytes/sector, 60669952 sectors
sd2 at scsibus5 targ 1 lun 0: <BUFFALO, USB Flash Disk, 4000>
sd2: 7788MB, 512 bytes/sector, 15950592 sectors
vnd0: not in use
vnd1: not in use
vnd2: not in use
vnd3: not in use
vnd4: not in use
vnd5: covering /sysmedia/fuguita-6.4-amd64.ffsimg on sd1a, inode 9
img: create FuguIta raw disk image on current directory
============================================================
Enter the name of device which FuguIta will be installed->vnd0 ← Specify an unused vnode device
Enter the name of device which FuguIta will be installed->img ← Specify "img" to create an image file.
Enter size of a vnode device file.
You can add suffix K, M, G or T (otherwise considered 'bytes').
->2g
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 3.076 secs (698129518 bytes/sec)
Disk: vnd0 geometry: 41943/1/100 [4194304 Sectors]
Offset: 0 Signature: 0x0
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
-------------------------------------------------------------------------------
0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
Select partition type:
1: [MBR]
2: GPT
3: Hybrid (not recommended if you wish modify partitioning later)
->
~ 略 ~
** Phase 5 - Check Cyl groups
3 files, 3 used, 386996 free (20 frags, 48372 blocks, 0.0% fragmentation)
? : ? ->bye
Bye bye...
$
A disk image file is created in the current directory by the above operations. The file name will be the same as the distributed one, "FuguIta-OPENBSD_VERSION-PLATFORM-RELEASE.img".
#aname(build_fuguita)
//*河豚板の構築 [#t980ad46]
*Building FuguIta [#v4a134e4]
//河豚板は不定期ではありますが、ライブシステム構築のために使用しているツールを開しています。
//この構築ツールを使用することで河豚板の布物と同じものを作成することができます。
The FuguIta build tool is irregularly published.
By using this build tool, you can create the same thing as the distribution of FuguIta.
//この節では、構築ツールを用いたFuguItaの構築手順について説明します。
This section explains the steps to build FuguIta using the build tool.
//**構築環境 [#q0e90e43]
**Build environment [#xf96ef38]
//以下の説明では、次のような環境を想定しています。
The following explanation assumes the following environment.
//-作業環境: OpenBSD 7.6 (最小ストレージ容量: 40GB)
-Working environment: OpenBSD 7.6 (minimum storage capacity: 40GB)
//-プラットフォーム: amd64 (推奨メモリ: 2GB以上)
-Platform: amd64 (recommended memory: 2GB or more)
//-インターネットへの接続が可能
-Availability for connection to the Internet
//-作業はすべてrootユーザで実施
-All operations are performed as root user
//>''【メモ】''~
//''⇒''この構築ツールでは、i386とamd64プラットフォームではFuguIta LiveDVDのISOイメージを、arm64プラットフォームではFuguIta LiveUSB(Raspberry Pi 3/4ではLiveSD)用の生ディスクイメージを生成できます。
//**OpenBSDのセットアップ [#t249f63d]
**OpenBSD setup [#x2828b7c]
//構築を行う前に、以下のような準備作業を行います。
Before starting build, perform the following preparations:
//-構築用PCに[[OpenBSD 7.6をインストール>https://www.openbsd.org/faq/faq4.html]]します。
-[[Install OpenBSD 7.6>https://www.openbsd.org/faq/faq4.html]] on the build PC.
//-このOpenBSD上で、オンラインマニュアル[[release(8)>man:release.8]]に従ってOpenBSD体の構築作業を行います。
-On this PC, build the entire OpenBSD according to the online manual [[release(8)>man:release.8]].
//>''【メモ】''~
//''⇒''[[release(8)>man:release.8]]で説明されているように、構築されたシステムをインストールするためのファイルシステムがルートファイルシステムとは別に要になります(release(8)で説明されている''DESTDIR''です)。~
//このファイルシステムは、OpenBSDのインストール時に指定するようにして下さい。サイズとしては概ね4GB以上を確保します。
>''[Memo]''~
''⇒''As explained in[[release(8)>man:release.8]], you will need a file system separate from the root file system to install the built system ( ``DESTDIR'' as described in release(8)). ~
Please specify this file system when installing OpenBSD. The size should be approximately 4GB or more.
//-[[ports(7)>man:ports.7]]システムについても、/usr/ports以下にファイルを取得・展開し、CVSでファイルを更新します。
-For [[ports(7)>man:ports.7]] system, obtain and extract the files under /usr/ports and update the files with CVS.
//**FuguItaビルドツールのセットアップ [#qcaf55ec]
**FuguIta build tool setup [#i2fa906f]
//-FuguItaの構築には、OpenBSD本体の他に、rsyncコマンドとpvコマンドが要です。パッケージからインストールします。
-In addition to OpenBSD itself, the rsync and pv commands are required to build FuguIta. Install from package.
# pkg_add rsync pv
quirks-7.50:updatedb-0p0:(ok)
quirks-7.50:(ok)
Ambiguous: choose package for rsync
a 0: <None>
1: rsync-3.3.0p2
2: rsync-3.3.0p2-minimal
Your choice: 2
rsync-3.3.0p2-minimal:(ok)
pv-1.8.5:libiconv-1.17:(ok)
pv-1.8.5:gettext-runtime-0.22.5:(ok)
pv-1.8.5:(ok)
The following new rcscripts were installed: /etc/rc.d/rsyncd
See rcctl(8) for details.
//[[FuguIta布サイト>FuguIta/Download]]のtoolsディレクトリから構築ツールfuguita-buildtools-7.6.tar.gzをダウンロードし、展開します。
Download the build tool fuguita-buildtools-7.6.tar.gz from the tools directory of [[FuguIta download site>FuguIta/Download]] and extract it.
# tar xvzpf fuguita-buildtools-7.6.tar.gz
//以下のコマンドを実行し、構築ツールの初期化を行います。
Execute the following command to initialize the construction tool.
# cd fuguita-buildtools-7.6
# make init
//これにより、構築に要なディレクトリなどが作成されます。
This will create the directories needed for the build, etc.
//OpenBSDの構築で生成したインストールセット (*76.tgz) をFuguIta構築ツールのinstall_setsディレクトリにコピーします。
Copy the install set (*76.tgz) generated by building OpenBSD to the install_sets directory of the FuguIta build tool.
# cp RELDIR/*76.tgz install_sets
//''RELDIR''は、[[release(8)>man:release.8]]の中で説明されている、生成されたリリースセットが格納されるディレクトリです。
//>''【メモ】''~
//''⇒''インストールセット*76.tgzはOpenBSDのオフィシャルミラーからダウンロードして使用することもできます。~
//ただしこの場合、作成されるFuguItaはそのリリースが開された時点でのOpenBSDがベースになりますので、それ以降のパッチは適用されていません。ご注意下さい。~
//また、この方法でFuguItaを作成する場合でも、/usr/srcや/usr/xenocara以下にOpenBSDのソースコードを展開しておく要があります。
''RELDIR'' is the directory where generated release sets are stored, as described in [[release(8)>man:release.8]].
>''[Memo]''~
'⇒'' Installation set *76.tgz can also be downloaded and used from the official OpenBSD mirror. ~
However, in this case, the FuguIta created will be based on OpenBSD at the time the release was published, so no later patches have been applied. Please be careful. ~
Also, even if you create FuguIta using this method, you need to extract the OpenBSD source code under /usr/src or /usr/xenocara.
//次に、FuguItaのユティリティから呼び出されるrsync, rlwrap, pvコマンドのビルドを行います。
Next, build the rsync, rlwrap, and pv commands that will be called from FuguIta's utilities.
//次に、FuguItaのユティリティから呼び出されるrsync, rlwrap, pvコマンドのビルドを行います。~
//このビルドには、以下の2つの方法があります:
//-A: ソースコードから独自にビルドし、/usr/fuguita 以下にインストール
//-B: portsシステムからビルドし、/usr/local 以下にインストール
//布版のFuguItaでは、Aの方法を採用しています。
//以下にA、Bそれぞれのビルド手順を説明します。
//***A: コマンドを独自ビルド [#m81f29fc]
//まず、ソースコードの取得を行います(xxHashは高速なハッシュ計算ライブラリです。rsync構築時に使用されます)。
First, get the source code (xxHash is a high-speed hash calculation library. It is used when building rsync).
//>まず、ソースコードの取得を行います(xxHashは高速なハッシュ計算ライブラリです。rsync構築時に使用されます)。
# cd /usr/ports/net/rsync && make fetch
# cd /usr/ports/sysutils/xxhash && make fetch
# cd /usr/ports/misc/rlwrap && make fetch
# cd /usr/ports/sysutils/pv && make fetch
//取得したソースコードは/usr/ports/distfiles下に置されます。~
//このソースコードをビルド用の作業ディレクトリにリンク(又はコピー)し、コンパイルを行います。
The obtained source code will be placed under /usr/ports/distfiles. ~
Link (or copy) this source code to the working directory for build and compile.
# pkg_add gmake (xxHashの構築に要です)
# cd (FuguItaビルドツールの置き場所)/fuguita-buildtools-7.6/fiopt/build
# ln -s fiopt.mk Makefile
# ln -s /usr/ports/distfiles/rsync-*.tar.gz .
# ln -s /usr/ports/distfiles/xxHash-*.tar.gz .
# ln -s /usr/ports/distfiles/rlwrap-*.tar.gz .
# ln -s /usr/ports/distfiles/pv-*.tar.gz .
# make RSYNC=rsync-3.3.0 XXHASH=xxHash-0.8.2 RLWRAP=rlwrap-0.46.1 PV=pv-1.8.5
//makeに与える引数には、実際に取得した各ソースコードのバージョンを指定して下さい。~
//ビルドが正常に完了すると、親ディレクトリにfiopt76.tar.gzが作成されます。
Please specify the version of each source code you have actually
obtained as an argument to make. ~
If the build completes successfully, fiopt76.tar.gz will be created in the parent directory.
# cd ..
# ls -l
total 1736
drwxr-xr-x 2 root wheel 512 Nov 15 02:58 CVS
drwxr-xr-x 7 root wheel 512 Dec 12 23:53 build
-rw-r--r-- 1 root wheel 867970 Dec 12 23:53 fiopt76.tgz
//これをinstall_setsディレクトリにリンク(又はコピー)します。
Link (or copy) this to the install_sets directory.
# cd ../install_sets
# ln -s ../fiopt/fiopt76.tgz .
# cd ..
//***B: portsを使用してコマンドをビルド [#jcd3682d]
//>この方法では、portsツリーから作成したrsync, rlwrap, pv(とその依存物であるlz4, xz, zstd, libiconv, gettext-runtime)をinstall_pkgsディレクトリにリンク(又はコピー)します。~
// # cd install_pkgs
// # ln -s /usr/ports/packages/amd64/all/lz4-*.tgz .
// # ln -s /usr/ports/packages/amd64/all/xz-*.tgz .
// # ln -s /usr/ports/packages/amd64/all/zstd-*.tgz .
// # ln -s /usr/ports/packages/amd64/all/libiconv-*.tgz .
// # ln -s /usr/ports/packages/amd64/all/rsync-*.tgz .
// # ln -s /usr/ports/packages/amd64/all/rlwrap-*.tgz .
// # ln -s /usr/ports/packages/amd64/all/gettext-runtime-*.tgz .
// # ln -s /usr/ports/packages/amd64/all/pv-*.tgz .
// # cd ..
//>>''【メモ】''~
//''⇒''これらのパッケージファイルも、OpenBSDのオフィシャルミラーからダウンロードして使用することもできます。~
//この場合も、FuguItaのリリースが開された時点でのものになりますので、ご注意下さい。
//FuguItaの構築に要となるファイルやコマンドを準備したら、最後に、以下のコマンドを実行し、構築環境をセットアップします。
After preparing the files and commands required to build FuguIta, finally execute the following command to set up the build environment.
# make setup
//>''【メモ】''~
//''⇒''install_setsの下にsite76.tgzというファイルを置いておくと、FuguItaをカスタマイズすることができます。このカスタマイズ方法はOpenBSDのhttps://www.openbsd.org/faq/faq4.html#site に準拠しています。~
//install.siteがsite76.tgzに含まれている場合、その容が/etc/rc.firsttimeに追加されます。~
//site76.tgzを加えてFuguItaを構築した結果、sysmedia/fuguita-7.6-amd64.ffsimgというファイルが2GBをえますと、ISOイメージが正しく作成されなくなります。ご注意下さい。
>''[Memo]''~
''⇒'' You can customize FuguIta by placing a file called site76.tgz under install_sets. This customization method complies with OpenBSD's https://www.openbsd.org/faq/faq4.html#site. ~
If install.site is included in site76.tgz, its contents will be added to /etc/rc.firsttime. ~
As a result of building FuguIta by adding
site76.tgz, if the file sysmedia/fuguita-7.6-amd64.ffsimg exceeds 2GB, the ISO image will not be created correctly. Please be careful.
//**FuguItaの構築 [#a9ad6923]
//最後に、FuguItaを構築します。~
//LiveDVDとLiveUSBの両方を構築するには、以下のようにします。
**Building FuguIta [#a9ad6923]
Finally, build FuguIta. ~
To build both LiveDVD and LiveUSB, do the following:
# make all
//また、
Only LiveDVD is built with
# make livedvd
and this will only build LiveUSB.
//でLiveDVDのみが構築され、
# make liveusb
//ではLiveUSBのみが構築されます。
//**構築後の調整 [#wfda33a7]
**Post-build adjustments [#l88edffa]
//***mode0symlinks.cpio.gzの作成 [#hba46272]
***Create mode0symlinks.cpio.gz [#j552ff1e]
//このファイルは、LiveDVDをモード0で起動した場合の時間短縮を目的としています(このファイルがなくても、FuguItaの起動自体に支障はありません)。
This file is intended to save time when starting LiveDVD in mode 0 (without this file, there is no problem in booting FuguIta itself).
//mode0symlinks.cpio.gzを作成するには、完成したLiveDVDをモード0で起動し、root権限でgen_mode0sldir コマンドを root で実行します。実行後、/etc/fuguita/mode0symlinks.cpio.gzというファイルが作成されます。
To create mode0symlinks.cpio.gz, boot the completed LiveDVD in mode 0 and run the gen_mode0sldir command as root with root privileges. After execution, a file called /etc/fuguita/mode0symlinks.cpio.gz will be created.
//このファイルをmode0symlinks.cpio.gz.amd64というファイル名で構築ツールの lib ディレクトリに置し、FuguItaを再構築すると、mode0symlinks.cpio.gzが組込まれたFuguItaが作成されます。
Place this file in the build tool's lib directory with the file name mode0symlinks.cpio.gz.amd64 and rebuild FuguIta to create FuguIta with mode0symlinks.cpio.gz installed.
# cp mode0symlinks.cpio.gz lib/mode0symlinks.cpio.gz.amd64
# make clean
# make all
//***fuguita_sys_mbの調整 [#tfa3add4]
//FuguItaには、/etc/fuguita/global.confというファイルがあり、以下のようにシステム体にかかわる設定を行っています。
***Fuguita_sys_mb adjustment [#tfa3add4]
FuguIta has a file called /etc/fuguita/global.conf, which contains settings related to the entire system as shown below.
fuguita_sys_mb=1122 # size of sysmedia.img
newdrive_defswap=16M # default swap size at usbfadm newdrive
memfstype=mfs # 'mfs' or 'tmpfs'
mfs_max_mb=30720 # mfs hard limit - 30GB
//このうち、fuguita_sys_mbはFuguItaのシステムを格納するパーティションのサイズを定義しており、FuguIta LiveUSBをリマスタリングする場合などにこの値が使われます。
Among these, fuguita_sys_mb defines the size of the partition that stores the FuguIta system, and this value is used when remastering FuguIta LiveUSB.
//fuguita_sys_mbの設定値は、LiveDVD構築時に生成されるlivecd.isoファイルのサイズに相当しますが、fiupdateユーティリティをによるアップデートを考し、10MBほど余裕をもたせると安全です。
The setting value of fuguita_sys_mb corresponds to the size of the livecd.iso file generated when building a LiveDVD, but it is safe to leave about 10MB in consideration of updates using the fiupdate utility.
# echo $(( $(wc -c < livecd.iso)/1024/1024+10 ))
//このコマンドで表示された値をlib/global.conf.amd64ファイルに書込み、makeを再実行します。
Write the values displayed by this command to the lib/global.conf.amd64 file and rerun make.
# vi lib/global.conf.amd64
# make clean
# make all
//**Makefileのターゲット [#y240b797]
//Makefile中の主なターゲットについて説明します。
**Makefile targets [#y240b797]
This section describes the main targets in the Makefile.
//:init|初期セットアップ: 構築に要なディレクトリの作成などを行います
:init|Initial setup: Create directories required for construction, etc.
//:setup|構築環境の最終セットアップ: 構築の材料となるファイルなどから、ブート関連やシステムのイメージファイルなどを作成します
:setup|Final setup of the construction environment: Create boot-related and system image files, etc. from the files used as construction materials.
//:livedvd|LiveDVDのリリースファイル(FuguIta-*-*-*.iso.gz)を生成します
:livedvd|Generate LiveDVD release file (FuguIta-*-*-*.iso.gz)
//:liveusb|LiveUSBのリリースファイル(FuguIta-*-*-*.usb.gz)を生成します
:liveusb|Generate LiveUSB release file (FuguIta-*-*-*.usb.gz)
//:all|LiveDVDとLiveUSBの両方のリリースファイルを生成します
:all|Generates both LiveDVD and LiveUSB release files
//:kernclean|カーネルのオブジェクトファイルを削除します
:kernclean|Delete kernel object files
//:kernreset|カーネルのオブジェクトファイルの一部を削除します。カーネルのランダムリンクを再実行するために用います
:kernreset|Remove some of the kernel's object files. Used to rerun random kernel links
//:kern|カーネルをコンパイルします
:kern|compile kernel
//:clean|リリースファイルやその中間生成物を削除します
:clean|Delete release files and their intermediate products
//:distclean|リリースファイル、中間生成物、構築材料をて削除し、構築環境を初期状態に戻します
:distclean|Remove all release files, intermediate products, and construction materials, returning the build environment to its initial state.
//:dvd2usb|sysmedia-7.6-amd76.img.gzがない状でLiveUSBを生成するために使用します。~
//このターゲットを使用するにはOpenBSDの仮想化システム [[vmm/vmd>https://www.openbsd.org/faq/faq16.html]]が動作している要があります。~
//make livedvdでLiveDVDのリリースファイルを作成後、このターゲットを実行すると、作成したLiveDVDのVMが起動するので、rootでログイン後、usbfadmのnewdriveサブコマンドでLiveUSBを作成します。~
//LiveDVDのVMをシャットダウンすると、引き続き今作成したLiveUSBのVMが起動するので、動作を確認します。~
//LiveUSBのVMをシャットダウンすると、このLiveUSBのリリースファイルが生成されます。~
//このLiveUSBのリリースファイルは[[sysmedia-7.6-amd76.img.gzとして利用でき>EBUG勉強会/20240525_FuguItaISO#content_1_13]]、以後、make liveusbが利用可能となります。
:dvd2usb|Used to generate LiveUSB without sysmedia-7.6-amd76.img.gz. ~
To use this target, the OpenBSD virtualization system [[vmm/vmd>https://www.openbsd.org/faq/faq16.html]] must be running. ~
After creating a LiveDVD release file with make livedvd, running this target will start the created LiveDVD VM, so after logging in as root, create a LiveUSB with usbfadm's newdrive subcommand. ~
When you shut down the LiveDVD VM, the LiveUSB VM you just created will continue to start, so check its operation. ~
This LiveUSB release file is generated when you shut down the LiveUSB VM. ~
This file is available as [[sysmedia-7.6-amd64.img.gz>EBUG勉強会/20240525_FuguItaISO#content_1_13]], and after that you can use make liveusb.
#navi(FuguItaGuide)