logo






http://fuguita.org/

FuguIta-Guide



by Yoshihiro Kawamata



Translated by Alfredo Vogel

from original Japanese guide

河豚板ガイド (FuguIta Gaido)





© All images are copyright of Yoshihiro Kawamata unless stated otherwise


Disclaimer Notice
This document is not a guarantee that FuguIta will work on your devices. In creating this document, the author (and the translators) tried to be accurate and clear, but acknowledge that they are not responsible for any damages caused as a result of implementing the contents of this document. Please use with care and ask if in doubt. If you have found any unclear explanation, missing parts, or differences between your device environment and this document, please let us know by sending an email to the author: kaw@on.rim.or.jp





TABLE OF CONTENTS







1. What is FuguIta?

FuguIta is a live system based on the OpenBSD operating system (OS).

FuguIta can be downloaded and used free of charge, and you can easily utilize the functions of OpenBSD by simply booting FuguIta from a DVD-R / DVD-RW or USB disk drive on your PC.

In addition, FuguIta supports a wide variety of boot methods, so you can not only use it as LiveDVD / LiveUSB, but also operate the network test environment easily and quickly, or use dedicated software by just turning on the power.

It can also be used for building a dedicated system that can be run on any computer.

This FuguIta guide covers how to use FuguIta; how to create boot media, boot into FuguIta, basic usage of FuguIta and procedure and settings for advanced applications.

If you need HELP visit the FuguIta BBS site at http://fuguita.org/index.php?FuguIta%2FBBS

If you don't have much experience with Unix-like operating systems and want to know the basics of Unix, see “Find out how to use Unix”.

If you have experience using other Unix-like operating systems such as Linux or FreeBSD and would like to know more about OpenBSD, please refer to “Find out how to use OpenBSD” in this document.

2. Create FuguIta media

In this chapter, we will show you how to create a DVD or USB memory disk to boot FuguIta. There are two main ways to use FuguIta . One is to burn FuguIta on a DVD-R or DVD-RW and boot from it, which is called "LiveDVD method". The other is to boot from a USB drive, which is called "LiveUSB method". FuguIta works in the same way regardless of whether you use the LiveDVD version or the LiveUSB version, but since each has its own characteristics, it is better to use it according to your requirements.





In general, it can be said that the LiveDVD version is suitable if you want certainty and economy of operation, and the LiveUSB version is suitable if you place importance on performance and convenience.

MEMO

You can also use the"best of both worlds" method of using both the LiveDVD version and the LiveUSB version at the same time. Using this technique, you can use, for example, the LiveUSB version of FuguIta on a PC that does not support USB booting or save and load data on the LiveDVD version of FuguIta.

To get started with FuguIta for the first time, follow these steps:

  1. Download the file from the FuguIta distribution site

  2. Decompress or unzip the downloaded file

  3. Write the extracted file to a DVD-R or USB memory

Each procedure is explained below.

2.1 Download FuguIta

FuguIta is free software. All editions, including the latest version of FuguIta, are published on the Internet and can be freely downloaded and used.

There are four download sites for FuguIta.



https://jp1.dl.fuguita.org/

https://jp2.dl.fuguita.org/

https://de.dl.fuguita.org/

https://fr.dl.fuguita.org/



The content of each site is the same, so you can download it from either site.

From within Japan, we recommend downloading at jp1.dl.fuguita.org or jp2.dl.fuguita.org.

Use the site nearest to your location for maximum download speed.

When you access these sites, you will see the contents shown on the image.




The filenames containing "FuguIta-" are the distribution images of FuguIta.

The meaning of the file name is as follows.

FuguIta-6.9-amd64-202106244.iso.gz
------- --- ----- --------- --- –-
   |    |      |       |     |   |
   |    |      |       |     |   +-> File compression format.
   |    |      |       |     |       -Compress using the gz ... gzip command
   |    |      |       |     |       -Compress using the xz ... xz command
   |    |      |       |     |       (Currently only available in gzip format)
   |    |      |       |     +-> File type:
   |    |      |       |         # Iso ... ISO image for writing DVD-R/DVD-RW
   |    |      |       |         # Img ... Raw image for writing to USB memory
   |    |      |       |         # Tar ... It is an archive format that 
   |    |      |       |                   collects files.
   |    |      |       +-> Release (version) of FuguIta
   |    |      |          # It is in the format of "date" and "serial number".
   |    |      |          #The serial number is when you make two or more FuguItas 
   |    |      |           in a day. It will increase one by one
   |    |      +->Supported platforms.
   |    |          FuguIta currently supports three platforms: i386, amd64,
   |    |          arm64
   |    |          Select the one that corresponds to the CPU model of your PC.
   |    +--> This is the version of OpenBSD that is the basis of this 
   +->FuguIta.

Select and download the file depending on whether you are creating a LiveDVD or LiveUSB, or your PC is an Intel 32-bit CPU or 64-bit CPU.

Note: Supported architectures.
As explained above, it is necessary to select either i386 or amd64 depending on the CPU type of the PC you are using, but amd64 is compatible with the conventional i386. It is the most common architecture in use.
Most of the PCs currently in use are CPUs with amd64 architecture.
arm64 is a version of FuguIta for the single board computer "Raspberry Pi 3".

After the download is complete, uncompress the downloaded file.

The following is an example of extracting a DVD-R / DVD-RW file from the shell command line on a Unix-like OS

> gzip -d FuguIta-6.0-amd64-201612251.iso.gz

When the extraction is completed, the file size will be about 1 gigabyte, and the file name will also have the .gz extension.

Note: "Raspberry Pi 3" version of FuguIta Is a tar format archive file.

Expand as follows.:

>tar xzvf FuguIta-6.7-arm64-202006244.tar.gz

Please refer to the README-arm64 file included in this archive file for how to create and start the Raspberry Pi 3 version of FuguIta.

2.2 Create a live DVD of FuguIta

To make a LiveDVD version of FuguIta, prepare a writable DVD media such as DVD-R or DVD-RW, and write the ISO file. The following is an example of writing a DVD on OpenBSD:

Frame3

MEMO: Since ISO burning software is widely available on other OS, you can create a live DVD of FuguIta using Windows, Linux and MacOS

2.3 Create a live USB of FuguIta

To make a LiveUSB version of FuguIta, prepare a USB memory with a size of 2 GB

or more, and write the downloaded and expanded IMG format file to it. The

following is an example of writing using OpenBSD:

Frame5


Caution: The "/dev/rsd0c" part in the above example is the name of the device to write to.
This depends on the connection status of the peripherals of your PC or the type of operating system that executes the dd command.
If you execute this command, all the data on the specified device will be erased, so be sure to check in advance whether the destination drive name is correct.



MEMO: Similar to ISO image writing software, various software programmes for writing raw images are available in other OS. Even if you use a USB memory of 2 GB or more, the part exceeding 2GB will not be used. If you want to create a LiveUSB version of FuguIta that matches the size of the USB drive memory, refer to "Installing FuguIta that matches the capacity of the USB memory" in this guide.

2.4 Boot device selection

When you insert the DVD or USB memory with FuguIta into your PC and start it FuguIta will boot.

MEMO: Even if you insert a DVD or USB memory and start the computer, Windows or Linux, that had previously been installed may start instead of FuguIta. This is because the PC has a priority setting for which device to use for booting, and this setting gives priority to booting the internal hard disk over DVD and USB drives. To enable booting FuguIta, change the setting in the BIOS menu of the PC to boot from the DVD or USB memory instead of the internal hard disk. The BIOS menu of the PC differs depending on the model, so please refer to the instruction manual of your PC or search on the Internet to find out how to access BIOS on your device.



When FuguIta starts, the following message is displayed:

> OpenBSD/amd64 CDBOOT 3.46
> boot>
> booting cd0a: /bsd-fi.mp: 12997960 + 2769928 + 2277408 + 0 + 708608 \ [806285 + 128 + 1028280 + 751803] = 0x145cb88
> entry point at 0xffffffff81001000
> [using 2587528 bytes of bsd ELF symbol table]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
> The Regents of the University of California. All rights reserved.
> Copyright (c) 1995-2020 OpenBSD. All rights reserved. Https://www.OpenBSD.org
> 
> OpenBSD 6.7-stable (RDROOT.MP) # 1: Fri Jun 5 09:41:45 JST 2020
> root@nimbus9.localnet: /opt/fi/6.7/sys/arch/amd64/compile/RDROOT.MP
> real mem = 1056825344 (1007MB)
> avail mem = 1010286592 (963MB)
> mpath0 at root
> ~ (a lot more info is displayed here) ~
> scsibus4 at vscsi0: 256 targets
> softraid0 at root
> scsibus5 at softraid0: 256 targets
> uhub1: illegal enable change, port 1
> root on rd0a swap on wd0b dump on rd0b  
> 

Normally the screen display turns white on a blue background after the kernel has booted. This message is displayed by the kernel or operating system itself.


This display shows the detection of devices and the memory of the PC and the connection status of peripheral devices, and are an important source of information when troubleshooting problems such as startup issues. When the OpenBSD kernel boot is complete, you will see the FuguIta banner.






Following the banner display of FuguIta, the disk drives installed or connected to the PC will be checked and the one which has FuguIta system installed will be shown.

In the example below, it says "FuguIta's operating device (s): cd0a.",

So you can see that the LiveDVD version of FuguIta is set in an optical drive such as a CD, DVD, or Blu-Ray.

Therefore, enter cd0a at the "Which is FuguIta's operating device?" prompt .

MEMO: After that, you will enter various values, but if "default: xxxx" is displayed in those prompts, it means that xxxx is the default value. In this case, just pressing the "Enter" key as shown in the example below is considered to be xxxx Enter.

*> scanning partitions: cd0a sd1d

*> FuguIta's operating device (s): cd0a

*> Which is FuguIta's operating device? [Default: cd0a]-> <<<<<<< Press Enter to accept default value



MEMO: In the OpenBSD operating system, disk devices are named according to the following rules.
First few letters are for the Device type
SCSI connection, USB connection hard disk, etc.
The number that follows ... If multiple devices of that type are connected, it will increase from 0.
The last letter ... Partitions within the device are generally used as follows;
Other than c partition and b partition, such partition name may be created by the user and there are cases where the above is not followed.
 

2.5 Temporary File System: tmpfs size setting

Next, we need to adjust settings related to memory. The example below first reports that this PC has about 1007 megabytes of memory installed. The user then enters how many megabytes of that 1007MB of memory will be allocated to tmpfs. FuguIta usually does not use the hard disk built into the PC, so instead it reserves an area in memory to hold directories and files. OpenBSD has a mechanism called tmpfs (Temporary File System) for that purpose, and FuguIta uses this tmpfs. If you specify 0 as the allocation size of tmpfs, it will be allocated automatically according to the installed memory. Since 0 is also the default value at the time of input, just pressing the "Enter" key will assume that 0 has been input. Normally, you can just accept the default value of zero.

   >  user memory: 1007 MB
 >  Enter tmpfs size in MB. (0MB is auto)
 >   [default: 0MB]->                    <<<====  press Enter
 >   tmpfs size will be automatically allocated 
MEMO: If you enter a value other than 0, that value will be the maximum file size that tmpfs can hold. For example, if you enter 100 <Enter> in the example above, files and directories can hold up to about 100 megabytes in total, and the remaining megabytes will be reserved for programme execution.

2.6 Boot mode selection

Let us now consider the boot mode selection. There are six boot modes, from mode 0 to mode 5, and at first boot we select the standard mode 0.

The six boot modes in FuguIta are:

0: fresh boot --standard mode as a live system
1: fresh boot --less memory, faster boot (/usr is non-writable, can't pkg_add)
2: fresh boot --works using only RAM (about 1GB or more of RAM required)
3: boot with retrieving saved files from storage device or enter passphrase for an encrypted volume
4: boot with retrieving saved files from floppy disk
5: interactive shell for debugging



2.7 Keyboard layout settings

Next is the keyboard language setting. For a Japanese keyboard, enter "jp" or "jp.swapctrlcaps". When you enter "jp.swapctrlcaps", the positions of the "Control" and "Caps" keys are swapped, and the "Control" key is to the left of the alphabet "A" key. If you are accustomed to key assignments such as the Emacs editor and Bash shell, this may be a good solution Enter keyboard type like this:

>pc-xt / pc-at keyboard:
>us de de.nodead fr fr.dvorak dk dk.nodead it uk jp sv sv.nodead no   no.nodead
 us declk us.dvorak us.colemak us.swapctrlcaps us.iopener uk.swapctrlcaps 
jp.swapctr lcaps fr.swapctrlcaps fr.swapctrlcaps.dvorak be.swapctrlcaps 
us.swapctrlcaps.dvorak us.swapctrlcaps.colemak us.swapctrlcaps.iopener es be ru 
ua sg sg.nodead sf sf.nodead pt lt la br tr tr.nodead pl hu si cf cf.nodead lv 
nl nl.nodead is is.nodead ee ee.nodead 
>keyboard type-> dk         <================ enter your language code from the list 
                                              (dk for Danish, for example) 
kbd: keyboard mapping set to dk

2.8 Setting administrator password

Following the keyboard settings, we now have to set the administrator password. On Unix-like operating systems such as OpenBSD, system administrators are called "super users" and other users are called "ordinary users". The superuser is assigned the user name of "root" as default, so set a password for root.

   Changing password for root.
   New password:                               <=== enter the password: input is not displayed
   Retype new password:                        <====  Enter again for confirmation: input is not displayed
MEMO: In OpenBSD, if the entered password is too short or too simple, a warning message will be displayed and the password will not be accepted.
The following type passwords are recommended for use:


2.9 Network related settings

Now we will enter the network-related settings.

CAUTION: The network settings differ depending on the environment of the network to connect to.
If a computer with settings that do not match the network environment is connected, it may have an unexpected effect on the network and the connected computer.
When connecting FuguIta to a company or public network, it is recommended to consult with the network administrator in advance about the connection settings.

2.10 Host name settings

First, give a name (host name) to the PC that runs FuguIta. In this example the host name is "fugu-demo".

    host name (without domain)-> fugu-demo

2.11 IP protocol version selection

The following is the setting of the IP protocol version to be used.

     IP version (s) to use: 4, 6, 46, 64 or n
    46: IPv4 preferred over IPv6 in address resolution
    64: reversed to 46
    n: stand alone operation
   [46]->

Enter "4" to communicate using only the IPv4 protocol, "6" to use only the IPv6 protocol, and "46" or "64" to use both IPv4 and IPv6. If you enter "n", the settings related to the IP network will not be made and the login screen will be displayed. If you hit the "Enter" key, it is considered that you have entered "46". Normally, you can hit the "Enter" key.

MEMO: When using both IPv4 and IPv6, both "46" and "64" can be specified, but the DNS inquiry order is different.
In "46", IPv4 is prioritized for address enquiries, and conversely, in "64", IPv6 enquiries are prioritized.
 

2.12 Network interface settings

Next, we must set the network interface.

First, a list of network interfaces connected to this PC and their status is displayed. The following display is the output of the network configuration command ifconfig, and in this example, three network interfaces, lo0, em0, and enc0, are displayed. This is followed by "Available network interface (s): em0", indicating that the available network interface is em0. As in the previous examples, em0 is displayed as the input default, so I only press the key to specify em0.

    >ifconfig -a
    lo0: flags = 8008 <LOOPBACK, MULTICAST> mtu 32768
    priority: 0
    groups: lo
    em0: flags = 8802 <BROADCAST, SIMPLEX, MULTICAST> mtu 1500 lladdr 52:54:00:12:34:56
    priority: 0
    media: Ethernet autoselect (1000baseT full-duplex)
    status: active
    enc0: flags = 0 <>
    priority: 0
    groups: enc
    status: active
    ========================================
    Available network interface (s): em0
    network interface to setup [em0]->               <=== hit Enter to accept default
MEMO: Since lo0 and enc0 are special interfaces, they are excluded from the setting candidates. "em" is the name given to Intel's Gigabit Ethernet interface. Even if an Ethernet interface or WiFi interface other than em is connected, they will be output to the ifconfig display. You can find out about individual network interfaces in the online manuals built into OpenBSD.

2.13 Domain name settings

Next, enter the FQDN (Fully Qualified Domain Name) of your PC. The FQDN is the name of this computer that you entered earlier, plus the domain name. The "hostname" for this computer is already displayed, so enter the rest of the domain.

  FQDN of this host-> fugu-demo.localnet             <==========localnet entered
MEMO: The domain name is not officially registered and managed in the home network, so give it an appropriate name. Generally, .local and .localnet are often used. If your network is managed by your organization, consult the administrator of that network for this information.
 

2.14 WiFi settings

After that, the following setting items will appear only when you select a WiFi device as the network interface. The name of the wifi network is shown as "my-wifinet" in this example.

    Wi-Fi SSID-> my-wifinet    <=== Enter the SSID of the WiFi you want to connect to
    WPA Key-> my-wpa-secrect-key  <=== Enter WPA key

If you enter only ENTER for the WPA key and do not set it, you will be asked for the WEP key during connection. We strongly recommend that you use the WPA method instead of WEP, as the WEP method is easily decrypted.

    Wi-Fi SSID-> my-wifinet

    WPA Key-> 
    WEP Key-> my-wep-unsecured-key
MEMO: WiFi devices require firmware supplied by the device manufacturer, and it may be necessary to download and install the firmware for operation. In this case, set up a wired LAN and connect to the Internet, then refer to the section on using WiFi devices that require firmware download and set up WiFi. If you enter only ENTER for the WEP key input, the WiFi connection will be attempted without either the WPA/WEP key. This is used, for example, when connecting to unprotected public WiFi networks.

2.15 IP address and DNS settings

Finally, there are DNS and IP address related settings.

MEMO: DNS (Domain Name System) is a mechanism for searching for an IP address such as "152.152.211.70" for a domain name such as "fuguita.org". When a computer starts communication, it first asks a DNS server to search for "fuguita.org", and then communicates using the IP address returned as the search result, "152.152.211.70".
There are three patterns for DNS settings.




If you the Enter key as shown in the example below, the settings will be made by DHCP, and the DNS server will be set automatically. DHCP also configures the IP address related settings for this PC.

MEMO: To use DHCP, a DHCP server must be installed in the network in advance. DHCP servers are often installed in home network devices and public Wi-Fi spots.
DNS setup;


On the other hand, if you manually set the IP address of the DNS server as shown below, then you will also make the settings related to the IP address of this PC itself. (If "none" is specified and DNS-less operation is selected, IP address related settings will be set in the same way.)


DNS setup;
Manual: Enter up to three IPv4/IPv6 addresses, separated by spaces
DHCP: Just press ENTER.
no DNS: Enter "none".
-> 172.16.1.16 <====== IP address of DNS server
IPv4 addr of this host-> 172.16.1.23 <====== IP address of this PC
netmask-> 255.255.0.0 <======= Netmask for this network
default route-> 172.16.1.95 <======= Default route for this network


 

2.16 Login method selection

Finally, specify how you want to log in. There are two ways to log in, one is to log in from the console screen and the other is to log in from the X server login screen (xenodm). In the example below, only the "Enter" key is entered to select login from the default console.

        Do you login with C) console or X) Window System?
        [default: C]->   <============== Enter "x" to log in from the X Window System.

That's all for the startup settings. After performing the remaining initialization process, the login screen will be displayed.



_________________________________________________

       / Setup for FuguIta ends. /
      / OpenBSD's boot sequence will follow. /
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                    

  Automatic boot in progress: starting file system checks.
    kbd: keyboard mapping set to dk
    pf enabled
    machdep.allowaperture: 0-> 2
    machdep.lidaction: 1-> 0
    .....shortened output .........
    starting network daemons: sshd smtpd sndiod.
    running rc.firsttime
    Path to firmware: http://firmware.openbsd.org/firmware/6.7/
    Installing: vmm-firmware
    starting local daemons: cron.
    fuguita: disabled KARL because of read-only media

    Thu Jul 2 06:51:57 UTC 2020

    OpenBSD / amd64 (fugu-demo.localnet) (tty00)
    login: 

When the login prompt "login:" is displayed, this PC is ready for use.

3. Using FuguIta (general use)

This chapter describes the basic procedure once the system is booted. In addition, we will introduce information which is useful for those who are not familiar with Unix-like OS and those who have experience using other Unix-like OS.

3.1 Log in and out as a system administrator

When FuguIta boot is complete, the OpenBSD operating system login screen is displayed. At first, only the superuser account can log in, so enter "root" at the "login:" prompt and the password set at startup at the "Password:" prompt.



    OpenBSD / amd64 (fugu-demo.localnet) (tty00)

    login: root    <================== type root here
    Password:      <================== type the root password (no echo here)
    OpenBSD 6.7-stable (RDROOT.MP) # 1: Fri Jun 5 09:41:45 JST 2020

    Welcome to OpenBSD: The proactively secure Unix-like operating system.

    Please use the sendbug(1) utility to report bugs in the system.
    Before reporting a bug, please try to reproduce it with the latest
    version of the code. With bug reports, please try to ensure that
    enough information to reproduce the problem is enclosed, and if a
    known fix for it exists, include that as well.

    You have new mail.
    fugu-demo # 

If the login is successful, the shell prompt "#" will be displayed and any command entered will be executed. As an example, let's execute the command ps.



    fugu-demo # ps -aux
    USER PID% CPU% MEM VSZ RSS TT STAT STARTED TIME COMMAND
    root 68528 3.6 0.1 868 884 00 Sp 6: 51AM 0: 01.89 -ksh (ksh)
    root 1 0.0 0.1 884 532 ?? I 6:40 AM 0: 01.68 / sbin / init
    root 14453 0.0 0.1 792 644 ?? Ip 6:43 AM 00: 00.47 / sbin / slaacd
    _slaacd 53995 0.0 0.1 812 784 ?? Ip 6:43 AM 0: 00.81 slaacd: engi
    _slaacd 33982 0.0 0.1 800 732 ?? Ip 6:43 AM 0: 00.81 slaacd: fron
    root 55401 0.0 0.1 712 548 ?? IU 6:44 AM 00: 00.17 dhclient: em
    _dhcp 78950 0.0 0.1 840 700 ?? Ip 6:44 AM 00: 00.10 dhclient: em
    root 86344 0.0 0.2 520 2184 ?? IpU 6:46AM 00: 00.64 syslogd: [pr
    _syslogd 45328 0.0 0.1 1128 1488 ?? Sp 6:46AM 0: 01.04 / usr / sbin / sy
    root 73380 0.0 0.1 836 584 ?? IU 6:46AM 00: 00.27 pflogd: [pri
    _pflogd 53476 0.0 0.1 876 540 ?? Sp 6: 46AM 0: 02.97 pflogd: [run
    _ntp 63935 0.0 0.3 1016 2868 ?? S <p 6:47 AM 0: 02.87 ntpd: ntp en
    _ntp 18769 0.0 0.2 820 2508 ?? Ip 6:47 AM 0: 01.86 ntpd: dns en
    root 34145 0.0 0.2 788 1568 ?? S <pU 6:47 AM 0: 00.81 / usr / sbin / nt
    root 63360 0.0 0.1 1324 1280 ?? I 6:47 AM 00: 00.37 sshd: / usr / s
    root 61566 0.0 0.2 1680 2052 ?? Ip 6:48 AM 0: 00.82 / usr / sbin / sm
    _smtpd 19845 0.0 0.4 1448 3940 ?? Ip 6:48 AM 0: 01.83 smtpd: klond
    _smtpd 66321 0.0 0.4 1716 4240 ?? Ip 6:48 AM 0: 02.23 smtpd: contr
    _smtpd 91561 0.0 0 .4 1552 4164 ?? Ip 6:48 AM 0: 01.95 smtpd: looku

    _smtpd 90688 0.0 0.4 1844 4396 ?? Ip 6:48 AM 0: 02.69 smtpd: pony
    _smtpq 16446 0.0 0.4 1640 4252 ?? Ip 6:48 AM 0: 02.47 smtpd: queue
    _smtpd 82450 0.0 0.4 1440 3988 ?? Ip 6:48 AM 0: 02.17 smtpd: sched
    _sndio 66682 0.0 0.1 516 744 ?? I <p 6:48 AM 00: 00.17 / usr / bin / snd
    _sndiop 92235 0.0 0.1 504 920 ?? IpU 6:48 AM 0: 00.08 sndiod: help
    root 1376 0.0 0.1 672 1268 ?? Sp 6: 51AM 0: 00.84 / usr / sbin / cr
    root 6575 0.0 0.0 484 360 00 R + pU / 0 7:32 AM 00: 00.35 ps -aux
    root 13541 0.0 0.1 288 1296 C0 I + pU 6:51AM 00: 00.58 / usr / libexec
    root 70324 0.0 0.1 292 1308 C1 I + pU 6:51AM 00: 00.54 / usr / libexec
    root 10475 0.0 0.1 296 1312 C2 I + pU 6:51AM 00: 00.44 / usr / libexec
    root 81779 0.0 0.1 292 1304 C3 I + pU 6:51AM 00: 00.58 / usr / libexec
    root 45364 0.0 0.1 284 1280 C5 I + pU 6:51AM 00: 00.47 / usr / libexec
   fugu-demo# 

ps is a command that displays what kind of program (process) is currently running. Even if the system does not show any action immediately after booting and the screen display does not change, you can see that many processes have already been started internally.

To log out, press "Control -D" at the shell prompt # or type "exit".

MEMO: "Control" -D means "hold down the <Control> key and press the" D Key ".<Control>-D is also sometimes referred to as "^ D".
        # exit

        OpenBSD/amd64 (fugu-demo.localnet) (tty00)
        login: 

When you log out, "login:" is displayed and you are ready to log in again.

3.2 Register a regular user

Immediately after startup you can only log in with the root account for the super user (system administrator). Unix-like operating systems usually log in as regular users for normal day-to-day use. To be able to perform system administration tasks, you, the general user, can become a temporary superuser, or you can log out as the general user, and then log back in as a superuser to perform administrative tasks.

Note: While logged in as a superuser, you can easily perform operations that render the system inoperable. Of course, there is no exception in the case of intentional mishandling. To prevent such risks, we strongly recommend that you create an account for a regular user and use it all the time, which is usually the case.

Below, we will try to create an account called yoshi as a general user. Since the creation of the user account is an action of system management, it is done as root. Use the command "adduser" to add user accounts. First, you will be asked the default shell name when adding a user account. This is only asked during the first run of adduser. Usually, all is fine with hitting the "enter" key.

        # adduser
        Couldn't find /etc/adduser.conf: creating a new adduser configuration file
        Reading /etc/shells
        Enter your default shell: bash csh ksh nologin nsh sh [ksh]:  <=== hit Enter
        Your default shell is: ksh -> /bin/ksh
        Default login class: authpf bgpd daemon default pbuild staff unbound
        [default]:    <====== hit Enter
         Enter your default HOME partition: [/home]:                            <====== hit Enter
        Copy dotfiles from: /etc/skel no [/etc/skel]:                           <====== hit Enter      
        Send welcome message?: /path/file default no [no]:                      <====== hit Enter
            Do not send message(s)
        Prompt for passwords by default (y/n) [y]:                              <====== hit Enter                    
        Default encryption method for passwords: auto FuguIta  [auto]:          <====== hit Enter
        Use option ``-silent'' if you don't want to see all warnings and questions.

      Reading /etc/shells
      Check /etc/master.passwd
      Check /etc/group

From here on, we shall create an account "yoshi" as a general user. As you can see, all or any of the inputs can be corrected at the end of the process (re-entered). Ok, let's go. Don't worry about mistakes. There will be a chance later to correct any input.

   Enter username []: yoshi         <=== User Account name in lowercase
    Enter full name []: Yoshihiro Kawamata                      <=== user's real name 
    Enter shell bash csh ksh nologin nsh sh [ksh]:              <===hit enter (login shell) 
    Uid :                                                       <=== (user ID assigned by OS) 
    Login group yoshi [yoshi]:                                  <=====hit enter (login group) 
    Login group is ``yoshi''. 
    Invite yoshi into other groups: guest no [no]: wheel        <====(group that allows user to become superuser) 
    Login class authpf bgpd daemon default pbuild staff unbound default:        <==== enter the login class 
    Enter password []: enter  password (not displayed) 
    Enter password again []: re-enter password for confirmation   


    Name:        yoshi
    Password:    ****
    Fullname:    Yoshihiro Kawamata
    Uid:         1000
    Gid:         1000 (yoshi)

    Groups:      yoshi wheel
    Login Class: default
    HOME:        /home/yoshi
    Shell:       /bin/ksh
    OK? (y/n) [y]: y    <=====Check your inputs
    Added user ``yoshi''
    Copy files from /etc/skel to /home/yoshi
    Add another user? (y/n) [y]: n   <==="y" if you want to create other user accounts

    Goodbye! 
MEMO: In the example above, we added yoshi to a group called wheel. Users in the wheel group can temporarily become root to perform system administration tasks.


Now that a general user account called yoshi has been created, we shall check if yoshi can actually log in.

fugu-demo# exit

OpenBSD/amd64 (fugu-demo.localnet) (tty00)

login: yoshi
Password:
OpenBSD 6.7-stable (RDROOT.MP) #1: Fri Jun  5 09:41:45 JST 2020

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

fugu-demo$ pwd
/ram/home/yoshi
fugu-demo$ ls
fugu-demo$ ls -a
.          .Xdefaults .cvsrc     .mailrc    .ssh
..         .cshrc     .login     .profile

fugu-demo$ ^D     <============ exit or logout

OpenBSD/amd64 (fugu-demo.localnet) (tty00)
login: 
MEMO: The shell prompt is # when you log in as root, but for general users, it is $ . The following examples follow this notation. OpenBSD does not allow SSH login with the root account. If you want to log in remotely with SSH, you also need to create an account for regular users.

3.3 Starting the X Window System

OpenBSD is shipped with a graphic environment called the X Window System, and FuguIta also uses the X Window System.

MEMO: X Window System can be called "X" or "X11" for short. To use X, select the X Window System as the login method, as described in Login Method
# Do you login with Console or X Window System? [default: Console] -> x

When X starts, you will see a login screen similar to the following, where you enter your username and password and hit Enter.










  







  









  

If you log in successfully, you will see the following screen.










  



  



  





  

The white window at the top left of the screen is called "Terminal Emulator", and it is a program for working with character terminals such as sessions with shells on X. The clock is displayed in the upper right corner. The one at the bottom left is called "xconsole", a program that displays system log information. Immediately after startup, the program is iconized. The one in the lower right table is called "Virtual Desktop", which allows you to switch between multiple desktop screens. The standard settings are 3x3 and one can switch between 9 desktop screens. In the background of the screen (in X, it is called the "root window"), press the left mouse button to display the menu. You can select and run the X app from this menu. Anything that is not in the menu can also be executed by inputting a command from the terminal emulator. The following screen is an example of actually running some applications.




In the root window, you can press the middle or right mouse buttons to display a different menu.

MEMO: X is designed for operation with a 3-button mouse. For mice without middle button, press both the left and right buttons at the same time, or press the wheel.

To exit X, in the menu of the left mouse button, select Exit, and then select Exit for the window that asks if it really ends.




MEMO: OpenBSD provides several types of software (desktop environment) for using X Window, and can also add software for displaying and inputting Japanese. This will be explained in “Introducing a Japanese desktop environment” to X Window System.

3.4 Shutdown and Exit FuguIta

To finish the operation of FuguIta log in as root and run the shutdown command.

fugu-demo# shutdown -h -p now
    Shutdown NOW!
    shutdown: [pid 4771]
    fugu-demo#
    *** FINAL System shutdown message from root@fugu-demo.localnet ***
    System going down IMMEDIATELY
         System shutdown time has arrived
   fugu-demo# syncing disks... done

In the example above, the option of the shutdown command is -h. The system halts because it specifies this option. Some PC models do not support power off with the -p option. In this case, one has to manually turn off the unit. If you specify the -r option instead of the -h or -p options, the system reboots.

ATTENTION!! If you stop or restart the system, any settings you made since startup, the user account you created, or changes such as creating, editing, or deleting files or directories will NOT BE SAVED and will be lost..


MEMO: One can always save and recover these various settings and data. This method is described in "Load the configured settings and files" that you want to load at startup. The fact that the operation performed on FuguIta lost when the system is stopped means that,in other words, it is difficult to change the existing systems installed on the internal hard disk. In other words, modifying the system and creating or erasing files and stopping processes as root has limited effect, so that you can practice system management with confidence.

3.5 Save settings and files FuguIta

All files such as user-created files, setting changes, added packages, system logs, etc. can be stored in the data storage partition created on the LiveUSB version of FuguIta and recalled at subsequent startup. To save the data, log in as root and run the usbfadm command.

MEMO: "usbfadm" stands for (USB Flash drive ADMINISTRATION tool).

Let us see how this is done in the following example.

$doas usbfadm
Welcome to usbfadm.
USB flash drive administration tool for FuguIta
Version/Arch: 6.0/amd64 (FuguIta-6.0-amd64-201612291) 
Boot mode: manual
Data stored in: not set 
Data Saved as: not set 
?:? Type? for help.

First, use the target command to specify the partition to save to. After verifying that the storage device is installed, press ENTER to scan the device. A device with a + sign in front of the device name is a device that can be used for storage.

? :? --> target Searching USB flash drives
Please make sure the device inserted. Then press ENTER -> cd0a sd0a +sd0d
target device--> sd0d

Next, name the data that you want to save using the saveas command. If the name
is omitted, the host name is used as the save name.

        sd0d :? -->saveas 
        Name of saved data --> fugu-demo    <======= type name of data file
        Your data will be saved as ``fugu-demo''

Initially, the prompt was "?:?" Notice that the prompt string has changed. The target command and saveas set values are displayed in the prompt so that you can check them. Finally, run the sync command to actually save the data.

 /dev/sd0d : fugu-demo -> sync 
Sync current mfs as fugu-demo, OK? -> y 
building file list... done 
created directory /mnt/livecd-config/fugu-demo./etc/
etc/bgpd.conf
etc/boot.conf
 ::
 var/yp/Makefile.yp
 var/yp/Makefile.yp.dist
 var/yp/README
 sent 16455591 bytes  received 232568 bytes  180412.53 bytes/sec
 total size is 15492096  speedup is 0.93

Display information of data saved by the info command.

 /dev/sd0d: fugu-demo-> info
 Filesystem Size Used Avail Capacity Mounted on  /dev/sd0d  218M 18.9M 179M  9.6%     /mnt
Scanning ...
18.9M 6.0/amd64/fugu-demo

The data storage completes without errors it will end usbfadm.

  /dev/sd0d: fugu-demo-> bye
#
Note: Save by usbfadm can also be performed from the shell command line.
# usbfadm -r
========================================
= Sync current tmpfs as fugu-demo into /dev/sd0d
=
sending incremental file list
deleting etc/X11/xenodm/authdir/authfiles/A:0-G4H73h
:
var/spool/smtpd/purge/
var/spool/smtpd/temporary/
 #

Option -r instructs usbfadm to re-execute file saving. You can also use cron to run data saving regularly in the background.

 (Crontab file)
      # crontab file
      # minute hour mday month wday command
      ~ shortened output ~
      #save session periodically
      # 0      */4  *    *     *    PATH=$PATH:/usr/local/bin /usr/fuguita/sbin/ usbfadm -rq. 

This allows usbfadm saving every 4 hours in the background. -q is the "Quiet" option that does not display progress and other information.

Note: A partition created by the usbfadm command, even if it is formatted in his FFS format of OpenBSD is a partition that is created in a directory /livecd-config.

3.6 Load saved settings and files at startup

Data saved can be read at subsequent boot and the FuguIta environment can be restored. Select Boot Mode 3 to reload the data.

Boot modes:
0: fresh boot - standard mode as a live system
1: fresh boot - less memory, faster boot (/usr is non-writable, can't pkg_add)
2: fresh boot - works using only RAM (about 1GB or more of RAM required)
3: boot with retrieving saved files from storage device
or enter passphrase for an encrypted volume
4: boot with retrieving saved files from floppy disk
5: interactive shell for debugging
->3
scanning partitions: sd0a sd0d sd0i cd0a
Device(s) found:
loadable from: sd0d
Which is FuguIta's storage device? [default: sd0d] -> sd0d
/dev/sd0d : available data;
fugu-demo
config name -> fugu-demo
Copying files from flash to ram ... <=========this can take quite some time 

                                              depending on the amount of data

If you specify the saved data name, the data that have been saved will be returned and the startup will resume. All settings are also reloaded including network settings and others, etc.,equivalent to the first boot mode 0 described earlier. After logging in, you can also save further data. The procedure is the same as described in “Settings and Saving Files”, but since the file is already stored on LiveUSB, only the files and directories that you have changed are restored. And since the save device name and save name have already been set, it is OK to run the sync command at any time. During shutdown, data is not automatically saved so you must manually run the usbfadm command each time before shutting down the system. If you want to automate this, please refer to the section about saving data and changes automatically later in this document.

4. Find out how to use Unix


As explained at the beginning of this guide, FuguIta is based on OpenBSD, a type of Unix-based OS. Unix was developed about half a century ago in 1969, and since then various versions have been created for different CPUs and computers. Unix-like operating systems are now used in a variety of environments, from supercomputers to smartphones, home appliances, and small embedded devices. Unix-like operating systems are very difficult to operate when compared to operating systems such as Microsoft Windows, and some people may not know how to use them at first. The basic part of a Unix-like OS is not designed for consumer users. OpenBSD is no exception, and there were very few friendly user interfaces in the early days for users without any preliminary knowledge. In other words, it is not "I understood how to use it while playing and trying and digging here and there inside OpenBSD". The question arises then on what approach should one take to understand and learn how to utilize such Unix-based operating systems?

4.1 I'm ready for a book

Is there a book that explains the basics of Unix-like operating systems?

Unix-based operating systems with various implementations have a common idea, also known as Unix philosophy. Understanding and practicing this idea is the key to learning a Unix-based OS. The content of such a book should not only cover specific implementations, but also provide a comprehensive and systematic explanation of basic concepts from commands to applications.

There are not many books that say "If you read this one book, everything will be OK", so, I will list some of the well-established ones.

Books read by people working at UNIX for the first time:

Masahiko Kimoto and others, KADOKAWA ASCII Media Works New, "The Unix Super Text" Kazuki Yamaguchi and Kazutaka Furuse, Technical Review Company

Reading the following as supplementary reading may help you to understand better what the BSD philosophy is all about:

"The Idea of Unix – Its Design Philosophy" By Mike Gancarz

Some general Unix user guides:

"Unix Made Easy" by John Muster A general Unix book that covers all areas of the system.

"UNIX Power Tools" by Jerry D. Peek, Tim O'Reilly, and Mike Loukides This book is now in its third edition. It discusses hundreds of neat tricks, little-known techniques, and add-on utilities. Be aware that many of the utilities are either included with OpenBSD or, more commonly, are already available as ports or packages. One needs to learn about the Ports System in OpenBSD to understand the use of packages and applications.

4.2 Let's do it ourselves.

One good reason for this is that after all, moving your hands and using tools yourself is the basis for effective skill acquisition. So, in that case, instead of trying and testing it, let's use the online manual (man command) installed in OpenBSD.



4.3 Let's utilise the online manual.

Because the manual pages are part of the system, it does not have the disadvantages of books or the Internet which both can show out-of-date descriptions, or explanations based on different implementations of Unix in the past. One should also make use of OpenBSD documentation which is regularly updated such as FAQ and the User Manual.

MEMO: Unix manual pages are broken up into several chapters. Items with the same name may be in more than one chapter. For example, "sleep" is in both chapters 1 (general command) and chapter 3 (library functions) and is written as sleep(1) and sleep(3), respectively. So, if you want to know the command line of the sleep command,
$ man 1 sleep
Structure of man pages in OpenBSD
Section
Description
1
General commands
2
System calls
3
Library functions covering in particular the C standard library
4
Special files (usually devices found in /dev) and drivers
5
File formats and conventions
6
Games and screensavers
7
Miscellaneous
8
System administration commands and daemons

If you're programming in C and want to know how to use sleep functions,

 $man 3 sleep 

displays the description of the sleep function in Chapter 3. Therefore, after this, notations such as "ls(1)" will appear, but this means "please run "man 1 ls" and refer to the "ls" section in chapter 1 of the online manual". Aside from the online manual, many of the Unix commands have the function of displaying their own usage descriptions.

  $ man 
usage: man [-acfhklw] [-C file] [-I os=name] [-K  encoding] [-M path] [-m path]
       [-O option=value] [-S subsection] [-s section] [-T output] [-W level]
       [section] name ...
          $cp -?
 cp: unknown option -- ?
usage: cp [-fip] [-R [-H | -L | -P]] source target
       cp [-fip] [-R [-H | -L | -P]] source ... directory

In the example above, the help message of the man command and cp command is displayed. In this way, the command's help message is a very simple description, it is a memorandum to remember command line options that you may have forgotten.

4.4 Use the Internet as reference information

The Internet makes it easy to get information related to Unix-based operating systems. However, there are weaknesses described in the previous paragraph. In particular, you need to decide for yourself whether search results in search engines apply to the actual machine in front of you. It is a good idea to use the results of the search site as "reference information". In addition, many Unix-based operating systems now have "official websites" and forums by the development community and others. The information on the official website can be used as basic starting information.

4.5 Summary of this section

If you think about the above-mentioned topic for example, "attributes of a file", it will be as follows; get the basics from a book what the "rwx" group permission of the file is and what commands it accepts. Test actual operation checking with online manuals, etc. and actually run the chown, chgrp, chmod command, etc., and check the result. Use the man command to find out what command line options are available. Get relevant and reference information on the internet, such as searching the Internet,looking for issues that are easy to understand and solve, various application methods, and information on the official website of the software developer. In particular, look for recent changes to specifications, missing security hole information,etc. FuguIta itself is good for learning Unix-based OS. In particular, taking advantage of the features of the FuguIta live system that does not require installation, it provides an environment where users can easily try and test various things, without destroying or damaging the running OS. It only needs a reboot and one is back to the original state of the system.

5. Find out how to use OpenBSD

In the previous section, we looked at how to use Unix in general, and we've discussed tips for people who don't have much experience with Unix-based operating systems and their use; this section provides a readily available source of information about OpenBSD and key points on how to use it.

5.1 Introduction

When you log in as root, you receive an email from OpenBSD project development leader Theo de Raadt.

 # mail
 Mail version 8.1.2 01/15/2001.  Type ? for help.
 "/var/mail/root": 1 message 1 new
 >N  1 deraadt@do-not-re  Sun Oct 18 07:58   86/4565  Welcome to OpenBSD 5.8!
& more 1
Message 1:
From deraadt@do-not-reply.openbsd.org Sun Oct 18 07:58:58 MST 2015
Date: Oct 18 07:58:58 MST 2015
From: deraadt@do-not-reply.openbsd.org (Theo de Raadt)
To: root
Subject: Welcome to OpenBSD 5.8

This message attempts to describe the most basic initial questions that a
system administrator of an OpenBSD box might have.

You are urged to save this message for later reference. .... (hereinafter
abbreviated).... This email answers some questions that the person who
installed OpenBSD may have at first.  By following the source of information
given in the email you can obtain information about using OpenBSD.

5.2 Online documentation

As mentioned in “Using Unix”, manual pages are an important source of information for Unix-based operating systems, and OpenBSD is no exception. This is also highlighted in the email to root immediately after installation:

"Again, PLEASE READ THE MANUAL PAGES. Our developers have spent countless hours improving them so that they are clear and precise."

The manual page also provides several entries, especially for deployment and first-aid help for Unix beginners. If you run the help command on the command line, you will also see this entry:

"man Description of the man command".

OpenBSD re-implements the manual page system with a program called mandoc, but the man command is used in much the same way as other Unix-based operating systems.

afterboot explains the items that should be checked immediately after installation. This is covered in more detail in the section called "FuguIta [General Edition]".

intro: The manual pages are divided into sections by category (see table above), details in each section.

In OpenBSD, the sections of the manual pages are as follows;

1 General commands

2 System calls and error numbers

3 library

3f Fortran Language Reference Guide

3p Perl Language Reference Guide

4 device drivers

5 File formats

6 games

7 other

8 Commands for system maintenance and operation

9 Kernel Internal Information

The documentation in each section continues to follow the current system version and is constantly updated and refined. Other Unix-based operating systems provide little information in section 4 (device drivers) and other chapters, but OpenBSD provides these too so that you can get enough information even if you need drivers or firmware depending on the hardware. For example, wifi settings.




Emacsinfo: For commands derived from the GNU project or applications running on Emacs, there may be documentation in Info format. To view info documents, run the info command.

MEMO: In environments with additional Emacs editors installed, info documents can be viewed from the Emacs editor by typing <Meta>-x info<Enter> or <Esc>-x info<Enter>. In addition to man pages and Info, there are application-specific documentation. They are mainly under the following directories:

5.3 Files on the system

All configuration files are in the folder called /etc. Software added in the package management tool ports/packages is installed below /usr/local, but is placed below /etc for configuration files. The same is true for X-related configuration files. The system operating log can be below /var/log. Only cron creates a log file called /var/cron/log. The startup kernel message described in Start FuguIta is recorded in a file called /var/run/dmesg.boot. After the system is started, you can check the contents of this file to investigate the state of system startup.

5.4 Information on the Internet

Information about OpenBSD and how to use it are given in the following websites. The OpenBSD Foundation website:

https://www.openbsdfoundation.org/

This is the main website for OpenBSD:

https://www.openbsd.org/

This is the start of OpenBSD-related information on the web, including detailed guides on OpenBSD in general and system updates. Also includes links to FAQ and documentation of the current OpenBSD version.

https://undeadly.org/ OpenBSD Journal:

OpenBSD-related news site. Each time, a new topic about OpenBSD is published it appears here. Information about latest developments of OpenBSD also appear here. For example, an article on FuguIta was also posted on this website.

Mailing list:

There is an officially managed and operated mailing list. There are also these archive sites that you can browse on the web without having to subscribe to the mailing list. The OpenBSD manual page server is here https://man.openbsd.org/

5.5 Books

As far as the author knows, Japanese books written for OpenBSD users have not been published since 2015.

Some of the books for Unix in the BSD system are:

BSD HACKS – 100 Professional Techniques and Tools / By Dru Lavigne, Supervised by Yasunari Momoi, Translated by Hideyuki Hayashi / O'Reilly Japan

For English books, please refer to the description on the official website.

https://www.openbsd.org/books.html  
NOTE: A very complete handbook for OpenBSD is
“Absolute OpenBSD”. 2nd Edition by Michael W. Lucas ISBN-10: 1593274769 ISBN-13: 978-1-59327-476-4 April 2013, 536 pp.

6. Using FuguIta [Advanced Edition]

In "Using FuguIta[General edition]", the basic use and procedures of FuguIta were explained. In this chapter, we will introduce further usage that takes advantage of the characteristics of FuguIta.

MEMO: This chapter will assume that the same operating system environment set in "Using FuguIta (in General)" will be used according to the following:


6.1 Add applications

Developers have added useful tools to the software provided by OpenBSD, such as applications and system management tools that are often used. Users can add applications after starting the system. To add applications, it is easy with OpenBSD's ports/packages system. To add software, use the pkg_add command as root. As an example, here is the installation of Mozilla Firefox, a web browser. (replace the "5.8" part in the example with the version of the FuguIta you are actually using).

$ su -
Password:
# export PKG_PATH=ftp://ftp.jaist.ac.jp/pub/OpenBSD/5.8/packages/i386/
# pkg_add firefox
quirks-2.114 signed on 2015-08-09T15:30:39Z
quirks-2.114: ok
firefox-39.0.3:nspr-4.10.8: ok
firefox-39.0.3:nss-3.19.2: ok
firefox-39.0.3:icu4c-55.1p0: ok
firefox-39.0.3:mozilla-dicts-en-GB-1.3p0: ok
firefox-39.0.3:hunspell-1.3.2p2: ok
firefox-39.0.3: ok
Look in /usr/local/share/doc/pkg-readmes for extra documentation.
--- +hunspell-1.3.2p2 -------------------
Install mozilla dictionaries for extra hunspell languages.
e.g.
    # pkg_add mozilla-dicts-ca
# exit
 $ firefox http://fuguita.org/

In the example above, "su" is used to make the user root to action the "pkg_add" command. You can also log out yoshi and log in again as root and run pkg_add. pkg_add will also install other software needed to run the application. In the firefox example above, nspr, nss, icu4c, mozilla-dicts-en-GB, hunspell were also installed as dependencies.

When the installation is complete, two types of comments are displayed:

There is documentation available for the software installed: 
in the folder /usr/local/share/doc/pkg-readmes. 
One can add more dictionaries for spell checking by issuing the following command:
$su
#pkg_add mozilla-dicts-ca


NOTE: Using the web browser to add software: Visit ftp://ftp.jaist.ac.jp/pub/OpenBSD/6.9/packages/i386/ which is a directory with all the packages for OpenBSD ver.6.9 for architecture i386
NOTE: The ports/packages system is explained in http://www.openbsd.org/faq/faq15.html
Also, in the example above, we used ftp.jaist.ac.jp as the download source, but there are other download sites, and you can see them on http://www.openbsd.org/ftp.html
It is also possible to directly compile and install the source code released by the software developer without using ports/packages.
In FuguIta pkg_add added software is also subject to the data 'storage/reload' process as executed by the "usbfadm" command.

6.2 Allow regular users to temporarily become system administrators

In adding the application in the previous section, we showed you how to use the "su" command to temporarily make the general user into root and perform system administration work. One can also use the command "doas".

"Doas" is easier to use than the "su" command because it can control the operation in the configuration file, and it is possible to execute commands with root privileges without knowing the root password. To use doas, you must first edit the configuration file called /etc/doas.conf. Initially, doas.conf does not exist, so run the following command to create the file.

# echo permit :wheel > /etc/doas.conf 
# chmod 0640 /etc/doas.conf 

This creates a file doas.conf with only one line called permit :wheel. This means "allow users in the wheel group to execute commands with root privileges". Using doas it is possible for a general user to save files using the usbfadm as in the following example.

$ doas /usr/fuguita/sbin/usbfadm 
Password: 
Welcome to usbfadm. USB flash drive administration tool for FuguIta
    Version/Arch: 6.0/amd64 (FuguIta-6.0-amd64-201612291) 
        Boot mode:usbflash
        Data stored in: /dev/sd0d Data Saved as: fugu-demo 
Type ? for help. /dev/sd0d : 
fugu-demo -> 





If you set doas.conf as described earlier, you will be asked for the password when you run doas, but enter your own user password instead of the root password. You can also run doas without entering a password. See manual for doas.conf(5) for details.

MEMO: doas is a command re-implemented by the OpenBSD developers to replace sudo, which is commonly used in Unix-based operating systems. sudo is not included in the OS itself since OpenBSD 5.8, but can be installed and used from ports.

6.3 Change Time Zone

Immediately after starting in mode 0, the time zone (time zone) is UTC (Universal Co-ordinated Time).

To change the time zone of FuguIta to Mountain Time of Canada, enter the following command and change the file pointing to the symbolic link/etc/localtime.

$ cd /etc
$ ls -l localtime
 lrwxr-xr-x  1 root  wheel  23 Dec 23 02:27         
localtime -> /usr/share/zoneinfo/UTC
$ doas ln -s -f /usr/share/zoneinfo/Canada/Mountain localtime
Password:
    $ ls -l localtime
    lrwxr-xr-x  1 root  wheel   25 Dec 23 11:28 localtime -> 
    /usr/share/zoneinfo/Canada/Mountain
    $ date
Wed Dec 23 11:28:53 JST 2015

    $

6.4 Server configuration example – Change the NTP server

The Network Time Protocol (NTP) is a protocol (communication convention) that allows a computer to communicate over a network and synchronize time. OpenBSD uses NTP to synchronize its own time to time standards on the Internet, which are also used by FuguIta. OpenBSD decides whether to use NTP during installation. FuguIta uses , this function by default . The function of NTP is implemented by a program called ntpd(8), and to see how ntpd works, run the command ntpctl(1).

MEMO: NTP software used in OpenBSD is called "OpenNTPD" and was created by OpenBSD developers. Linux and FreeBSD use a different implementation of ntpd.
$ ntpctl -s status
4/4 peers valid, constraint offset 0s, clock synced, stratum 3

If clock synced is displayed as shown in the example above, ntpd communicated with the external NTP server and as a result, the time is synchronized.

    $ ntpctl -s

status 0/1 peers valid, clock unsynced



If clock unsynced, is shown, the time is out of sync for some reason. In OpenBSD, when the NTP function is enabled during installation, the server group pool.ntp.org is referenced as the time standard, and the setting of FuguIta follows it. In some cases, corporate internal LAN, etc., communication with external NTP servers is not desired for security reasons. In such a case, if an NTP server is operated on-premises LAN, it is possible to accurately maintain the time of its host by referring to that server instead of NTP. The following shows how to set up an NTP server:

Since ntpd is set by a file called ntpd.conf(5), the ntpd.conf is modified or edited with root privileges.

$ doas -s

Password:
# vi /etc/ntpd.conf
        ntpd.conf 
        servers pool.ntp.org
        sensor *
constraints from "https://  www.google.com"
Change to the following local network server:
ntp.localnet 

In the example above, we have changed the settings to refer to the NTP server called "ntp.localnet". When you have finished editing the configuration file, restart ntpd to reflect the changes. Programs like ntpd that run in the background and provide services are called daemons in Unix. OpenBSD allows you to use the command rcctl(8) (as root) to control the daemon.

# rcctl restart ntpd
ntpd(ok)
ntpd(ok)

Now that you've completed the configuration change process, you'll be back from root to the general user. The behaviour of ntpd is monitored with ntpctl.

# exit
$ ntpctl -s status
 1/1 peers valid, clock unsynced



If the reply is as shown above time is not synchronized (yet), it shows that one peer (Peer, referenced NTP server) is enabled.



$ ntpctl -s status
1/1 Peers Valid, Clock Synced, Stratum 3



After a while, it is confirmed that time synchronization is OK. ntpctl can also view the status of ntpd in more detail. ntpd itself logs everything to a log file such as / var / log / daemon or / var / log / messages, so you can find out more detailed ntpd behaviour by examining them. For more information, refer to the man page for each command or configuration file.

NOTE: ntpd will make the time shift very slowly. Therefore, if the time deviation is large, it may take a long time for synchronization.

6.5 Change OS settings

In the previous section, we explained how to change the NTP server. This section describes changes of settings to the services running on OpenBSD.Because it is not possible to adjust all services and settings they are divided into categories and each category will be described separately.

6.6 Kernel Parameters

OpenBSD kernel functions can be controlled in various ways, but the easiest method is to use the sysctl (8) command.

$ sysctl -a | less

kern.ostype = OpenBSD
kern.osrelease = 5.8
kern.osrevision = 201510
kern.version = OpenBSD 5.8-stable (rdroot.mp) # 2: Wed Nov 11 13:18:48
JST 2015
root@nimbus5.localnet: /opt/fi/5.8/sys/arch/i386/compile/rdroot.mp

kern.maxvnodes = 44152
kern.maxproc = 1310 
etc.

In the example above, all kernel parameters are displayed. Since the display content does not fit in one screen, the display data is passed to the pipe program less. If the parameter you want to display is known in advance, you can specify that name. The following example displays the maximum amount of memory to be assigned to file input and output buffering.

$ sysctl kern.bufcachepercent
kern.bufcachePercent = 20
$



From this reply, it can be seen that it is set to assign up to 20% of the amount of memory loading into the buffer. To change this value you require root privileges, so execute the sysctl command via doas commands.

$ doas sysctl kern.bufcachepercent = 50

Password:
kern.bufcachePercent: 20-> 50
$

You can also set it automatically at system startup, not manually executing the sysctl command. To do this, add the appropriate line to the file sysctl.conf (5).

6.7 Basic Network Settings

As described above, network-related settings are performed at the start of FuguIta, so there is no need to change the setting, especially if communication is performed without any problems. If you want to operate FuguIta as a server or network gateway, etc., you may need to change or add settings. Interface Settings for network interfaces such as IP addresses, netmasks, are set in the files /etc/hostname. This file format can be referenced in hostname.if (5).

NOTE: Which network interfaces are available to the PC are shown by the command "ifconfig -a".
Routing control: The default route is written in /etc/mygate. To perform other route controls, write the route control daemon or run the Route command to /etc/hostname.if or /etc/rc.local
Resolve: create settings in /etc/resolv.conf (5).
Packet filtering: PF is a packet filter developed by OpenBSD, and has very rich features in addition to filtering, such as bandwidth control and address translation of networks. Refer to pfctl(8) or pf.conf(5) .

6.8 Daemon Start/Stop and Settings

Various daemons are installed and included with OpenBSDs that do not run by default. Changing the NTP server, was an example of the NTP daemon, the daemon starts/stop and setting change was described earlier. Similar steps can be applied to other daemons. OpenBSD controls such daemons via rc.conf.local(8), and in this file specifies starting and stopping of daemons at boot time.

NOTE: In actual fact, rc.conf(8) applies to all daemons, and rc.conf.local overwrites rc.conf settings.
To control the behaviour of various daemons, change the contents of rc.conf.local, by editing it with the text editor, but one can also use the command rcctl(8) to start and stop daemons.
As ntpd is set by ntpd.conf, other daemons have a unique configuration file, and many are located directly in the /etc folder.
In addition, since the sample files for setting various daemons are located in /etc/examples and these files can be copied and edited to create the actual configuration files for each daemon.

6.9 Other Settings

/etc/rc.local is a shell script that runs at the final stage of system startup. If you want to perform other processes that have been described so far, write to this /etc/rc.local. Refer to rc(8) for scripts run at OpenBSD startup or ending.

6.91 Boot Modes and File Layouts explained

The FuguIta file tree layout is different for each boot mode and the layout is illustrated and explained in this chapter.

It is important to understand the differences between the boot modes to be able to perform file operations and package installations as well as compiling programs.

Boot Mode 0:

The figure shows the file layout in boot mode 0. As examples, the paths /bin/ed, /usr/bin/vi, and pkg_added /usr/local/bin/emacs are shown.




The root file system is rd(4). This rd (ram disk) device is attached to the kernel and has been already mounted from the system boot time. Under the root, there is an unfamiliar directory called "boottmp". This is where you will find the commands needed at the very beginning of the system boot, and utilities specific to FuguIta.

The FuguIta device itself, a DVD or USB flash drive, which holds the boot loader, OS kernel, and file system images. It is mounted read-only on /sysmedia. The filesystem image in /sysmedia is mapped to /dev/vnd4 and mounted on /fuguita. This is the OpenBSD file tree. This is pretty much as it should be, except for a few modifications to fit to the live system. Also, this is read-only. So no files can be created, modified, or deleted in it. /ram is a memory file system called TMPFS (temporary file system), which is both readable and writable. Files that need to be modified, such as /etc/*.conf, your own data under /home/YOU, and the pkg_added program, are located on this. In addition, files that are rarely modified are replaced by symbolic links towards equivalent files in /fuguita. This will reduce the memory usage of TMPFS.



Boot Mode 1:






Boot mode 1 is the same as mode 0, but /usr is symbolically linked to /fuguita/usr. This makes the boot process faster and uses less memory than mode 0 by not copying/linking /usr to /ram. However, /usr/local is not writable, so adding packages using pkg_add is not possible.

Boot Mode 2:



Boot mode 2 is much simpler than boot modes 0 or 1. Only / and /ram are mounted, and all external devices are unmounted. All files can be modified and the modified system has to be saved before shutting down or rebooting.

6.10 Reduce the startup time. Low memory – Boot mode 1

If mode 1 is specified when FuguIta is started, the boot time is shortened. The various setting items to be entered are the same as mode 0.

Select boot mode;

  0: fresh boot (normal)
  1: fresh boot (lower memory, faster boot than mode 0)
  2: fresh boot (works only on tmpfs)
  3: retrieve user data from USB flash memory
  4: retrieve user data from floppy disk
  5: interactive shell for debugging

->1



Memory usage (TMPFS size) after startup is also smaller than mode 0.

As a guide, it is possible to operate from a machine with a memory of 64MB;

File usage (mode 0)
$ df -h
Filesystem Size Used Avail Capacity Mounted on /dev/rd0a 1.6M 729K 833K 47%
/
/dev/cd0a 697M 697M 0B 100% /sysmedia
/dev/vnd5a 676M 664M 11.9M 98% /fuguita
tmpfs 698M 25.5M 673M 4% /ram


File usage (mode 1)
$ df -h
Filesystem Size Used Avail Capacity Mounted on /dev/rd0a 1.6M 730K 832K 47%
/
/dev/cd0a 697M 697M 0B 100% /sysmedia
/dev/vnd5a 676M 664M 11.9M 98% /fuguita
tmpfs 713M 6.8M 706M 1% /ram

However, boot mode 1 has a merit that there are less necessary resources compared to mode 0, which is standard boot mode, but there is the disadvantage that you can not change the files and directories below /usr. In other words, you can not add an application through pkg_add.

Start-up Mode 1 can be used if only software installed on FuguIta is used. If you boot in mode 1, use usbfadm to save the file, and then reboot in mode 3, the above situation will carry over.

6.11 FuguIta without using media – Boot mode 2

Boot mode 2 transfers all files to TMPFS and FuguIta is run from RAM memory.

Select boot mode;
  0: fresh boot (normal)
  1: fresh boot (lower memory, faster boot than mode 0)
  2: fresh boot (works only on tmpfs)
  3: retrieve user data from USB flash memory
  4: retrieve user data from floppy disk
  5: interactive shell for debugging
-> 2



When system startup is complete, DVD or USB memory is unmounted, so you can remove any of those devices. Since all program execution and file reading is performed in RAM memory, it can be expected to operate at very high speed compared to mode 0 and mode 1.



$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/rd0a  1.6M 730K 832K  47%      /
tmpfs      813M 736M 76.7M 91%      /ram 



However, as described at the beginning, this mode 2 copies all system files on DVD and USB memory to TMPFS, so PC RAM memory needs to be approximately 800 MB or more as a guide. If it is restarted in mode 3 after file saving in mode 2, the state at the time of mode 2 is restored.

6.12 Install FuguIta using the total space available on the USB drive – usbfadm command

As described in "Creating a LiveUSB of FuguIta", one can download the image file from the download site, deploy it by writing it on a LiveUSB. However, this LiveUSB version can only use 2GB space regardless of USB drive size. Of this, the system occupies about 1 GB, so it is about 1 gigabytes available for saving data with usbfadm. This section explains how to install FuguIta to another USB drive from a running FuguIta OS. Using this method, you can assign data storage areas of any size (in the following example, it is assumed to install to an USB drive of 8GB (7788 MB)).

First, start FuguIta in mode 0 or mode 1. The booted FuguIta can be from both LiveDVD version or LiveUSB version.

When startup is complete, run the usbfadm command with root permission.

    $ doas usbfadm
    doas (yoshi@fugu-demo.localnet)
    Password:

    Welcome to usbfadm.
    USB Flash Drive Administration Tool for FuguIta

       Version/arch: 6.4/amd64 (FuguIta-6.4-amd64-201902021)
          Boot mode: usbflash
    Data Stored in: /dev/sd1d
      Data Saved As: fugu-demo

    Type ? For Help.

    ?:? -> newdrive   <=== new drive for a different USB

    Please make sure the device inserted.
    Then press ENTER ->    <=== confirm the installation of USB memory by hitting  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
    ============================================================
    Enter the name of device which FuguIta will be installed->sd2   <====new LiveUSB
    Disk: sd2   geometry: 992/255/63 [15950592 Sectors]
    Offset: 0   Signature: 0xAA55
            Starting         Ending     LBA Info:
     #: id      C   H   S -      C   H   S [       start:        size ]
    -------------------------------------------------------------------------------
    *0: 0C      0 130   3 -      2 140  10 [    8192:       32768 ] FAT32L
     1: 00      0   0   0 -      0   0   0 [       0:       0 ] unused
     2: 00      0   0   0 -      0   0   0 [       0:       0 ] unused
     3: A6      2 140  11 -    130 138   8 [       40960:     2056192 ] OpenBSD

    This disk seems to have been partitioned already.
    Continue anyway? [y/N] -> y

    Select boot method:
      1: [Legacy BIOS]
      2:  UEFI
      3:  none (only for save data)
      4:  Hybrid
    ->                   <====== Specify the startup method
              If you enter only ENTER here the default is accepted:Legacy BIOS.


    Enter size for saving User Data.
      You can add suffix K, M, G or T (otherwise considered 'bytes').
      '*' implies 'all'
      '0' doesn't make this partition.

    6GB (14516928sectors) free
    ->3g  <===== Size of data storage area
              Assign 3 gigabytes with "3G"  When "*" is input, it means all the remaining

    Create an extra FAT partition? [y/n] -> y          <====== Whether to set the remaining area to FAT
    target disk: sd2
      partition type=MBR
           boot type=Legacy

    -------------------- : ------
               partition:   size
    -------------------- : ------
              whole disk:    7GB
        partition tables :   32KB
             UEFI system :     0B
          FuguIta system :  946MB
       FuguIta user data :    3GB
               MSDOS FAT :    3GB
    -------------------- : ------

    ***THIS IS THE LAST CHANCE***
    If you type 'Y' now, all the data on sd2 will be lost.
    Are you sure to initialize sd2? [y/N] -> y  <===== Write to the specified USB memory         
                        Final confirmation
    ========================================
    = Clearing MBR, GPT and BSD disklabel
    =
    21+0 records in
    21+0 records out
    22020096 bytes transferred in 5.693 secs (3867757 bytes/sec)

    ========================================
    = Setting up fdisk partitions
    =

      ~ Omitted ~

    ** /dev/rsd2d
    ** File system is already clean
    ** Last Mounted on /mnt
    ** Phase 1 – Check Blocks and Sizes
    ** Phase 2 – Check Pathnames
    ** Phase 3 – Check Connectivity
    ** Phase 4 – Check Reference Counts
    ** Phase 5 - Check Cyl groups
    3 files, 3 used, 3663622 free (14 frags, 457951 blocks, 0.0% fragmentation)

    ? : ? ->quit

    Bye bye...
$

The system is written and available on the specified device.

MEMO: Please check the device name of the destination drive. Writing to an incorrect device loses all the data stored there.









  



  

If you have followed the instructions described so far, the USB drive will be partitioned as shown on the image above.

If "Legacy BIOS" or "UEFI" is selected for "Select boot method:", a partition is created, and the system of FuguIta is written there. This partition is a fixed size of 946 MB. If you enter "none", no partition is created (in this case the drive will be USB memory dedicated to data storage). A Data partition of the size entered in "Enter Size for Saving User Data" is created and the usbfadm data is stored. If there is an unused area after securing the area of the partition and Data partition, "Create an extra FAT partition? [y/n] ->" It asks you. If answer Y to ensure i or j partitions. This partition is a FAT file system and it is formatted and can be accessed from other OSs such as Windows. Since OpenBSD can also mount FAT partitions, it can be used to exchange data between FuguIta and other OS.

NOTE: To install FuguIta by the method described in this section can be used for installation on an entire storage device that OpenBSD can recognize. For example, in this way SD cards, compact flash memory or ATA and SATA hard disks can be used for installation.
Current PCs have two types of startup method:"BIOS" and "UEFI" How to create USB drive as described above is compatible with BIOS (MBR or legacy boot) startup.

To create USB memory for UEFI boot specify "UEFI" as the start method as the start boot method.

Select boot method:
      1: [Legacy BIOS]
      2: UEFI
      3: None (Only for Save Data)
      4: Hybrid
    -> 2

    Select partition type:
      1: [GPT]
      2:  MBR
   ->1

You can also create USB memory that can be started by either BIOS or UEFI by specifying the boot method "Hybrid". But please note that if you change the partition with the fdisk command later problems occur.

6.13 Automatic booting: noasks file

During boot there are times when you have to enter information manually, regardless how FuguIta is started.

For example:

1. Which device do you use to boot? (Which is FuguIta's operating device?)

2. How much of the available memory is assigned to TMPFS? (Enter tmpfs size in MB.)

3. Which device do you use to boot? (Which is FuguIta's Operating Device?)

4. How much of the available memory is assigned to TMPFS? (Enter tmpfs size in MB.)

5.Which boot mode do you use? (boot modes)

The above five items can be converted to automatically input the data.

To do this, write the values required to a file named noasks on the LiveUSB version and save it to FuguIta's Data partition.

    $ doas -s
    doas (yoshi@fugu-demo.localnet)password:
    # mount /dev/sd0d /mnt
    # cd /mnt
    # ls -l
    total 2
    drwxr-xr-x  9 root  wheel  512 Dec 23 06:24 livecd-config
    -rw-r--r--  1 root  wheel  302 Oct 27 07:50 noasks
    total 4

    drwxr-xr-x 5 root wheel 512 Oct 23 19:29 livecd-config

    # cd livecd-config/7.0/amd64

    # ls -l

    drwxr-xr-x 11 root wheel 512 Nov 10 17:08 fugu-demo

    -rw-r--r-- 1 root wheel 422 Nov 9 22:19 noasks

    #



NOTE: Directory LiveCD-config is his directory for data storage via the usbfadm command. “noasks” contains a set of statements which are commented out by # at the start of each line. To activate the command it needs to be uncommented (remove the # sign).
    # vi Noasks
    #
    # noasks - parameter settings for non-interactive boot
    #
    # Make statements uncommented
    # to activate settings
    #
    #
    # FuguIta system device
    noask_rdev=sd0a
    #
    # tmpfs size in MB
    noask_umem=0
    #
    # boot mode
    noask_setup_rw_mode=3
    #
    # storage device
    noask_confdev=sd0d
    #
    # data set name in USB flash drive
    noask_confdir=fugu-demo

NOTE: Please do not put spaces before or after the equal sign "=" in the assignment statement of the setting value.  (The noasks file will be interpreted as a shell script).


Edit and restart the system after unmounting the Data partition as root.

    # cd
    # umount /mnt
    # /sbin /shutdown -r now

If the setting of the value by the noasks file is correct, you will see the following message;



    ============================================
    =     ______               __   _
    =    / ____/              |  |_| |__
    =   / /____  ______  __  _|  /_   _/_____
    =  / ___/ / / / __ \/ / / |  | | | /  _  |
    = / /  / /_/ / /_/ / /_/ /|  | | |_| (_) |__
    =/_/   \____/\__  /\____/ |__| \___/____/__/
    =            __/ /
    =           /___/
    =
    = Welcome to FuguIta!  -  OpenBSD Live System
    =                 http://fuguita.org/?FuguIta
    =============================================
    scanning partitions: wd0i wd0j sd0a sd0d
    FuguIta's operating device(s): sd0a.
    Press ^C to cancel non-interactive boot

The "Press ^ C to cancel non-interactive boot" will wait for 5 seconds before

the automatic start-up starts. If you enter the Control+C automatic activation

by noasks file is aborted and FuguIta will return to normal operation.

MEMO: If there is nothing set in the noasks file, FuguIta will wait for input from the user of the item required by the automatic start. For the setting item in the noasks file, in addition to the normal device name, such as sd0a for noask_rdev and noask_confdev, is also possible to specify by DUID (Disklabel Unique IDentifiers). DUID is a unique hexadecimal string, which is automatically attached to the disk device. DUID can be seen from the output of the disklabel command.
    # disklabel sd0
    # /dev/rsd0c:
    type: ESDI
    disk: ESDI/IDE disk
    label: QEMU HARDDISK   
    duid: eac6323f6d34c465  <===== DUID
    flags:
    ~ more info  ~

For example, to specify the boot device of FuguIta in the noasks file,

    noask_confdev = 'sd0d'

Or one could also write

    noask_confdev = 'eac6323f6d34c465.d'

Designation by the normal device name, sd0 and if the drive used as main disk device is changed sd1 for example, to specify always the same disk, regardless of the drive name, the device can be identified by the DUID.

6.14 Save data automatically at shutdown

The setting input at the beginning of the previous section can be omitted by using the automatic loading at the time of start-up of FuguIta. It is also possible to automate the process of saving the data at the end of a FuguIta session. OpenBSD is used to run the script /etc/rc.shutdown at shutdown of the system. To automate the saving of all modified data at the end of a session, add the following line to /etc/rc.shutdown:

    export PATH=$PATH:/usr/local/bin
    /usr/fuguita/sbin/usbfadm -r


NOTE: Because this process does not perform any error checking routine during the saving process, the system continues with shutdown even if saving fails.

If important work has been done during a session, it is recommended that you manually save data before shutdown.

6.15 Encrypt data storage area

As described earlier in Saving Files, the FuguIta USB has a partition for storing data. Encrypting storage areas protect the information stored in USB memory from access after being stolen or lost When creating LiveUSB with the usbfadm command, use the newdrive function of the usbfadm command, and create an encrypted partition by specifying the following.

    # usbfadm

    Welcome to usbfadm.
    USB flash drive administration tool for FuguIta

      Version/Arch: 6.7/amd64  (FuguIta-6.7-amd64-202006142)
         Boot mode: manual
    Data stored in: not set
     Data Saved as: not set

    Type ? for help.

    ? : ? ->newdrive    <===== command for new device
    ~omit~
    Enter sizes for swap, user data and extra FAT.
      You can add suffix K, M, G or T (otherwise considered 'bytes').
      '*' implies 'all'
      '0' doesn't make this partition.

    589MB (604128KB) (1208256sectors) free
    swap->64m


    525MB (538592KB) (1077184sectors) free
    userrdata->*

    user data encryption? [y/N] -> y       <==== say y for creating encrypted partition

    Enter passphrase twice. They'll be not echoed.

    //// CAUTION ////////////////////////////
    ////   If you lost this passphrase,    <==== There is no way to retrievethe passphrase: be careful.
    ////   you'll never access sd0d.       
    /////////////////////////////////////////

    Passphrase:           <=====Enter the passphrase for the encryption (input content is not displayed).
    Passphrase:           <======for confirmation, enter the pass phrase again
    ~ continued ~

To save the data on the encrypted partition, proceed with the following two-step procedure.

Specify the partition that has been encrypted with a target function of usbfadm, and enter the pass phrase. If the input of the passphrase is correct the new disk appears, next call target function again to specify the disk.

Finally, store the data using usbfadm sync function.

    ?:? -> target

    Searching storage device
    Please make sure the device inserted.
    Then press ENTER ->
        sd0a ?sd0d         <=====the one with the ? is encrypted partition
    target device -> sd0d        <===== specify that partition
    Passphrase:       <===== and enter the pass phrase
    sd1 at scsibus3 targ 1 lun 0: <OPENBSD, SR CRYPTO, 006>
    sd1: 525MB, 512 bytes/sector, 1076656 sectors
    softraid0: CRYPTO volume attached as sd1
    sd0a ?sd0d +sd1d           <===== passphrase is correct and new disk sd1d appears.
    target device-> sd1d         <======Specify sd1d as the save destination,
    sd1d : ? ->saveas
    Name of saved data->fugu-demo

    Your data will be saved as ``fugu-demo''.

    sd1d : fugu-demo ->sync

    Sync current tmpfs as ``fugu-demo'', OK? [y/N] -> y

    copying /ram to /mnt/livecd-config/6.7/amd64/fugu-demo (30688KB approx.):
    25.0MiB 0:00:38 [9673KiB/s][[===========================>] 83% ETA 0:00:07
    waiting for pax to finish ... syncing ... done.

    sd1d : fugu-demo ->bye

When saved data are read at subsequent startup, it will take two steps like in the case of saving. Specify boot mode 3 and specify an encrypted partition, and enter a passphrase.

If the passphrase is correct and a new disk appears, it calls mode 3 again and specify the disk.

            ============================================
            =     ______               __   _
            =    / ____/              |  |_| |__
            =   / /____  ______  __  _|  /_   _/_____
            =  / ___/ / / / __ \/ / / |  | | | /  _  |
            = / /  / /_/ / /_/ / /_/ /|  | | |_| (_) |__
            =/_/   \____/\__  /\____/ |__| \___/____/__/
            =            __/ /
            =           /___/
            =
            =  Welcome to FuguIta  -  OpenBSD Live System
            =                         http://fuguita.org/
            =============================================

            scanning partitions: sd0a sd0b sd0d cd0a
            FuguIta's operating device(s): sd0a cd0a.
            Which is FuguIta's operating device? -> sd0a
            activating swap partition: /dev/sd0b
              user memory: 239 MB
            Enter tmpfs size in MB. (0MB is auto)
            [default: 0MB] ->
            tmpfs size will be automatically allocated
            boot modes:
              0: fresh boot – standard mode as a live system
              1: fresh boot – less memory, faster boot (/usr is non-writable, can't pkg_add)
              2: fresh boot – works using only RAM (about 1GB or more of RAM required)
              3: boot with retrieving saved files from storage device
                 or enter passphrase for an encrypted volume
              4: boot with retrieving saved files from floppy disk
              5: interactive shell for debugging
            ->3      <====== Select boot mode 3
            scanning partitions: sd0a sd0b sd0d cd0a
            Device(s) found:
                  encrypted: sd0d    <======= This is the encrypted volume.
            Which is FuguIta's storage device? -> sd0d
            Passphrase:    <====== Enter a passphrase. If the passphrase is correct, a new disk will appear.
            sd1 at scsibus3 targ 1 lun 0: <OPENBSD, SR CRYPTO, 006>
            sd1: 525MB, 512 bytes/sector, 1076656 sectors
            softraid0: CRYPTO volume attached as sd1
            Passphrase successful: Select boot mode again...
            boot modes:
              0: fresh boot – standard mode as a live system
              1: fresh boot – less memory, faster boot (/usr is non-writable, can't pkg_add)
              2: fresh boot – works using only RAM (about 1GB or more of RAM required)
              3: boot with retrieving saved files from storage device
                 or enter passphrase for an encrypted volume
              4: boot with retrieving saved files from floppy disk
              5: interactive shell for debugging
            ->3         <====== Specify boot mode 3 again.
            scanning partitions: sd0a sd0b sd0d cd0a sd1d
            Device(s) found:
              loadable from: sd1d      <======= You can read it from the newly appeared disk.
                  encrypted: sd0d
            Which is FuguIta's storage device? [default: sd1d] -> sd1d    <=====Specify and read /dev/sd1d: 
                 Available Data;

                 fugu-demo

                 config name-> fugu-demo
                 Copying files from flash to RAM ...
                 done
                  ~ ~ Continue ~

This disk is also visible after startup, so it is not necessary to enter a passphrase again when saving data.

6.16 Use multiple FuguIta together

In most of the scenarios discussed until now, whether it has been described on the assumption that use either FuguIta in LiveDVD version or LiveUSB version, what would happen if you start both, the LiveDVD and LiveUSB on the same PC? Alternatively, run two LiveUSB? FuguIta has been designed to work well even in such a case. First of all, which of the two, DVD or USB, is started immediately after the power is turned on? This depends on the settings in the BIOS of the PC as described in “Starting FuguIta”.

scanning partitions: wd0i wd0j
    cd0a sd0a sd0d FuguIta's operating device(s): cd0a sd0a. 
Which is FuguIta's operating device? -> <===== Enumerates the available devices, and you are being asked which one to use. 
NOTE: In the above example, wd0i and wd0j are assumed to be built-in hard disks. The built-in Hard disk are shown if Windows is installed and two partitions of the C drive and D drive exist. When loading saved data, you will be asked which one to use. For example, if boot mode 3 is selected while two LiveUSB are inserted, two candidates sd0d and sd1d are displayed as follows;
Boot modes:
  0: fresh boot – standard mode as a live system
  1: fresh boot – less memory, faster boot (/usr is non-writable, can't pkg_add)
  2: fresh boot – works using only RAM (about 1GB or more of RAM required)
  3: boot with retrieving saved files from storage device
     or enter passphrase for an encrypted volume
  4: boot with retrieving saved files from floppy disk
  5: interactive shell for debugging
->3
scanning partitions: wd0i wd0j sd0a sd0d sd1a sd1d
Device(s) found:
  loadable from: sd0d sd1d
Which is FuguIta's storage device?  ->   <=====If you want to save data with the usbfadm with the Target command specify the device, as described in Saving Settings and Files. 
NOTE: By applying the above, it is possible to operate from an SD card.
As described in ”Installing FuguIta according to the capacity of USB memory”, the usbfadm command allows you to install FuguIta on storage devices other than USB memory.
There is almost no PC that supports starting from SD card, but if you load the LiveDVD version and the SD card version of FuguIta, start the system with LiveDVD and operate the system using an SD card,


NOTE: USB memory is mounted only when saving and retrieving data, so it can be removed if not needed for that purpose. It is also possible to use the "launch and running FuguIta from separate devices" for multi-booting OpenBSD,Windows, Linux and FuguIta. This is explained in the next section.
NOTE: The boot setting automatic method described earlier is executed if there is only one noasks file for all partitions. If two or more noasks files are detected, automatic execution is aborted for safety and FuguIta switches over to manual input.

6.17 Multi-booting OpenBSD and FuguIta

If OpenBSD is already installed on a PC on which you want to run FuguIta, you can launch FuguIta LiveDVD or LiveUSB by placing a FuguIta on the installed OpenBSD. As a principle, it is a method of placing the kernel and ISO image of FuguIta on the existing OpenBSD partition, and activating the kernel of FuguIta using the existing boot loader. The following describes the installation and activation method. Start the existing OpenBSD first and log in with root. Next, create a directory called "ISO" directly below the root directory. Download and deploy the FuguIta ISO image in this /ISO directory.



# mkdir /ISO
# cd /ISO
# ftp http://mirror.ginzado.ne.jp/pub/FuguIta/FuguIta-6.0-amd64-201612251.iso.gz
Trying 110.92.1.251...
Requesting http://mirror.ginzado.ne.jp/pub/FuguIta/FuguIta-6.0-amd64-201612251.iso.gz
100% |**************************************************|   322 MB    07:48

338634465 bytes received in 468.48 seconds (705.90 KB/s)
# ls -l
total 661632
-rw-r--r--  1 root  wheel  338634465 Dec 29 00:55 FuguIta-6.0-amd64-201612251.iso.gz
# gunzip FuguIta-6.0-amd64-201612251.iso.gz
# ls -l
total 1427648
-rw-r--r--  1 root  wheel  730744832 Dec 29 00:55 FuguIta-6.0-amd64-201612251.iso

Copy the FuguIta kernel contained in the ISO image directly below the root directory. vnconfig(8) is a command that allows ISO and USB memory image files to be accessed as storage devices.

# vnconfig vnd0 FuguIta-6.0-amd64-201612251.iso
# vnconfig -l
vnd0: covering FuguIta-6.0-amd64-201612251.iso on wd0a, inode 25986
vnd1: not in use
vnd2: not in use
vnd3: not in use
# mount -r /dev/vnd0a /mnt
# ls -l /mnt
total 1427119
-r-xr-xr-x  1 root  bin        71452 Apr  4  2015 boot
-rwxr--r--  1 root  wheel       2048 Dec 27 11:59 boot.catalog
-rw-r--r--  1 root  wheel    5569179 Dec 27 19:19 bsd-fi
-rw-r--r--  1 root  wheel    5577796 Dec 27 19:19 bsd-fi.mp
-r-xr-xr-x  1 root  wheel      72328 Dec 27 19:19 cdboot
-r-xr-xr-x  1 root  wheel       2048 Dec 27 19:19 cdbr
drwxr-xr-x  2 root  wheel       2048 Apr 18  2014 etc
-rw-r--r--  1 root  wheel  719388672 Dec 27 19:19 fuguita-5.8.ffsimg
# cp -p /mnt/bsd-fi /mnt/bsd-fi.mp  /
# umount /mnt
# vnconfig -u vnd0
# vnconfig -l
vnd0: not in use
vnd1: not in use
vnd2: not in use
vnd3: not in use
#
NOTE: If you want to save and reload data, create a directory called livecd-config. However, it can not be created in the same place as the ISO directory because the partition where the ISO directory was created is not writable and is mounted while FuguIta is running. Therefore, partitions appropriate for creating livecd-config are, for example, /home or /var directly below the mounting point of the partition. The next time you start up, the PC starts and the "boot>" prompt is displayed just before the kernel message is displayed. If you do nothing here, the existing OpenBSD system will start, but if you enter the kernel you want to start, that kernel will start up.
boot> bsd-fi.mp

This "bsd-fi.mp" is a FuguIta kernel for a multiprocessor. If you
 want to launch FuguIta kernel for a single processor, enter "bsd-fi".
NOTE: In the above explanation, the ISO directory and the livecd-config directory are created directly under the root directory, but they will work even if they are not under the root directory, as long as they are directly under the partition where the OpenBSD filesystem is created.

6.18 Multi-booting Windows, Linux and FuguIta

In FuguIta, partitions formatted with Windows NTFS, FAT,Linux EXT-2, EXT-4 file system can also be used as an operating system device. This method is almost the same as the procedure described for multi-booting OpenBSD and FuguIta.

Start the OS to be used from the hard drive.

Create a folder named ISO for the file system on that OS (Windows if Windows, D Drive, Linux, root directory and other mount points), Place the ISO image of FuguIta in that folder. If you use FuguIta from Windows or Linux file systems, there are the following limitations:

At this stage, you can not start the OpenBSD kernel placed on Windows or Linux file systems. Therefore, it is possible to use a LiveDVD version or a LiveUSB version of FuguIta only for kernel boot choice. Because Windows and Linux file systems do not support data storage and recovery, use LiveUSB's FuguIta for data storage and reload.

6.19 Enable swap partition

Typically, FuguIta does not use swap and works with main RAM memory, but in the case where normal OpenBSD and FuguIta are multi-booting, the OpenBSD swap partition is detected and enabled.

Which is FuguIta's operating device? -> wd0a
activating swap partition: /dev/wd0b
activating swap partition: /dev/wd1b

In this example, two swap partitions: /dev/wd0b and /dev/wd1b are found and both are enabled. Swap partitions are activated simultaneously with detection. There is no way to disable/enable this.

NOTE: If you do not want to use swap for any reason (for example, a bad sector in the swap partition could kill the process, or you don't want to keep the memory image on disk), startup with mode 5 Select "interactive shell for debugging". After selecting, run the swapctl(8) command with the -d option when the shell opens and disable swap. If you get out of the shell, it will ask to select the boot mode again, so select the original boot mode and resume the process.

6.20 Add partition to mount

Usually, on UNIX OS, the partition to be mounted are specified in the file /etc/fstab. Therefore, if you want to add or change a partition to be mounted, you have to change the contents of fstab. However, in FuguIta, if the contents of the fstab file changes, after restart it will not reload that change. In FuguIta, all disk devices connected to the PC are initialised during start-up and system partition detection is performed. Also, if necessary, input from the user will be added. Finally, the fstab is automatically generated and the file system is mounted based on it. Therefore, even if the user changes and saves fstab, the contents will be overwritten at the next startup. If you want to add a partition to be mounted, write its contents to a file called /usr/fuguita/etc/fstab.tail. As an example, if you want to add e-partition of the disk sd2 to the directory /ram/opt, you will have to follow these steps:

Create /usr/fuguita/etc/fstab.tail. The format of this file is the same as /etc/fstab.

/dev/sd2e       /ram/opt        ffs     rw      0       1

If the /ram/opt directory does not exist, create it.

# mkdir /ram/opt

Use the sync function of the usbfadm command to save the file.

Reboot and elect boot mode 3 and verify that the specified partition is mounted.

The contents of the /usr/fuguita/etc/fstab.tail file is added to the end of the automatically generated /etc/fstab file, and then the file system is mounted.

NOTE: Mount points must be created in TMPFS (below /ram directory). The directory or file immediately below the /ram directory is automatically linked from the root directory at startup. Therefore, /ram/opt can be accessed as /opt.

6.21 Install desktop and X Window System

On FuguIta, you can execute the command of dtjsetup to install a desktop environment. The following is an example of execution of dtjsetup.

    # dtjsetup   <===== Launch dtjsetup (You can use either root or general user)
    # = ===========================================
    # Welcome to dtjsetup
    # Desktop (and Japanese) Setup Utility
    #
    # for FuguIta-6.6-amd64-202001171
    # = ===========================================

    Which Desktop Software Will You Install?   <======= Select Desktop Environment
      1: No Desktop (WM Only)
      2: [rox-filer]
      3: XFCE
      4: Mate
      5: Lumina
      6: LXQT
            <========= If you enter only [Enter], the default is selected [rox-filer]
Which window manager will you install?   <====== In the preceding paragraph 1 (no desktop environment, window manager,manager only) or 2 (rox-filer)if selected, window manager
      1: cwm
      2: fvwm
      3: twm
      4: [icewm]
      5: fluxbox
      6: jwm
    ->

    Will You Setup Japanese Language Environment? [y/N] -> n   <====== No to install Non Japanese environment

*** You selected icewm as desktop software.
*** Installing Japanese environment is No.

*** Checking your root authorization...
*** OK.

*** Checking network accessibility...
*** OK.

    *** Installing packages: rox-filer icewm
    Will you continue? [y/N] -> y          <=======confirmation of whether or not to proceed
    quirks-3.183 signed on 2020-01-31T18: 21: 51Z
    rox-filer-2.11p3: libiconv-1.16p0: ok
    rox-filer-2.11p3: xz-5.2.4: ok
        :
    icewm-1.6.1: libsndfile-1.0.28: ok
    icewm-1.6.1: ok
    Running tags:
    New and changed readme (s):
    New and changed readme(s):
            /usr/local/share/doc/pkg-readmes/glib2
            /usr/local/share/doc/pkg-readmes/gtk+2

    *** /root/.xsession already exists.  <==== .xsession (X initialization file) exists already
    *** This will be replaced with a new file.            and back up the old file.
    *** and the old one will be renamed to /root/.xsession_20200206_170903.

    *** Rewrite .xsession configuration file.       <===== or .xsession to update?
    Will you continue? [y/N] -> y

    Copy this .xsession file to /etc/skel? [y/N] -> y   <===== Copy your .xsession to the /etc/skel?

    *** all installation and configuration completed.
    *** Check your /root/.xsession and login to X if OK.

    *** Note: You can save this configuration and additionally installed softwares
    ***   by using usbfadm utility.
    ***   And can reload them at next boot time by selecting boot mode 3.

Logout after making the above settings, log in from the xenodm login screen, and the deployed desktop environment is shown. You can add various applications using the pkg_add command in desktop environments.

6.22 Enable X Login Screen

When FuguIta starts, it will show the login from the console screen or the login from the X Window login screen (xenodm), as described in the Login Selection setup. Even if you select login from the console screen, you can later change to login from the X Window System login screen (xenodm).To do this, change the contents of the /etc/rc.conf.local file, as described in changing the OS settings. The following example is an example of enabling Xenodem using rcctl(8).

    $ doas rcctl enable xenodm  
    $ doas rcctl ls on
    check_quotas
    cron
    library_aslr
    ntpd
    pf
    pflogd
    slaacd
    smtpd
    sndiod
    sshd
    syslogd
    xenodm
    #

If you enable xdm with the rcctl command, you can see that rc.conf.local is added to "xdm_flags =".

    $ cat /etc/rc.conf.local
    xenodm_flags =
    $
NOTE: Editing rc.conf.local directly in the text editor also gives the same result. rcctl command was introduced in OpenBSD 5.7. After setting have been changed, save it with usbfadm, and then start up in mode 3 to load xenodm.
NOTE: Press <Control>+<ALT>+<F1> when xdm is displayed, and switch to the normal text login screen. The virtual console is always available and it can be accessed by typing <Control>+<ALT>+<F1> to <Control>+<ALT>+<F12>. The display of X is assigned to the fifth virtual console, so press <Control>+<ALT>+<F5> to return to the screen of Xorg server.

6.23 Update FuguIta

OpenBSD has major releases twice a year, and at that time, the version changes as OpenBSD 6.8 to OpenBSD 6.9 for example. The new version has been revised for security and stability improvement, bugs, etc. OpenBSD official site also offers bug fixing information in https://www.openbsd.org/errata60.html FuguIta also follows this error correcting process and the current version has been updated by using the error patches published by OpenBSD. To check the version of FuguIta OS currently running, execute this command:

    $ uname -a         <====== Check the version of the Operating System
    OpenBSD fugu-demo.localnet 5.8 RDROOT.MP#2 i386

    $ sysctl kern.version     <=======Check the kernel version
    kern.version = OpenBSD 5.8-stable (rdroot.mp) # 2: Wed Nov 11 13:18:48 JST 2015
    root@nimbus5.localnet: /opt/fi/5.8/sys/arch/i386/compile/rdroot.mp

    $ cat /usr/fuguita/version    <==== Check the version of FuguIta
    5.8-201512272

In the next section, we will explain how to update FuguIta to the latest version when the major release of OpenBSD is upgraded .

6.24 Major OpenBSD upgrade

For example to upgrade from FuguIta-5.8-amd64-201504161 to FuguIta-5.9-amd64-201510255 when the base of FuguIta changes from OpenBSD 5.8 to OpenBSD 5.9. System updates are difficult if the major release of OpenBSD is changing.

The reason is that when OpenBSD is upgraded, system call specifications, incompatible version upgrade, version upgrade, command, add, delete, and specification changes, etc., make it impossible to keep the previous environment. This is because partial upgrading or migrating to a new version is not possible in FuguIta. Migration across OpenBSD's major release is achieved by the following methods.



NOTE: Create a new LiveDVD or LiveUSB. Boot the new version of FuguIta and perform transition work such as various settings and files created by the user from the old version of FuguIta.

6.25 Update FuguIta without major OpenBSD upgrade

For example FuguIta-6.0-amd64-201511297 to FuguIta-6.0-amd64-201512051 where the "6.0" indicates that the version of OpenBSD has not changed.

In this case, since the change of system is a partial one, you do not need to migrate user data.

Only the changes in the system are needed.

6.25.1 Migration procedure with LiveDVD

Since in the case of LiveDVD the media cannot be modified, one needs to create

a new version of LiveDVD version of FuguIta. The saved data from a USB memo

drive can be used to restore data in start-up mode 3.

6.25.2 Migration procedure of LiveUSB In the case of LiveUSB,

By using the command fiupdate (FuguIta update), you can perform the update of the running LiveUSB .

To use the fiupdate, start the LiveUSB of the update target in the mode 0, 1 or 2.

Next, download the ISO image and MD5 file for the new version from the distribution site keep them in the same directory.

Then start fiupdate.

Note ; It is the ISO image file to use LiveUSB to update. * Please note that it is not the .img file. * MD5 file, fiupdate will be used to check that the contents of the downloaded file is not corrupted
    -rw-r--r-- 1 root wheel 310651490 Oct 7 01:12
     FuguIta-6.7-amd64-202010071.iso.gz -rw-r--r-- 1 root wheel 562 Oct 8 06:25 MD5
     fugu-demo#cat /usr/fuguita/version 6.7-amd64-20209041
     fugu-demo# fiupdate 202010071

    fiupdate - Live Updater for FuguIta LiveUSB
      Version/Arch: 6.7/amd64  (FuguIta-6.7-amd64-20209041)

    Checking…
    environment: ok



Note: We recommend that you run this command in fresh boot (boot mode 0, 1, or 2).
You must quit all application software and save all your data before updating the FuguIta device.
All daemons, including xenodm, will be stopped before the update.
Please note that all X sessions will be aborted.
        Do you proceed? [y/N] -> y

        Checking...
            checksum: (MD5) FuguIta-6.7-amd64-202010071.iso.gz: OK
             file layout: liveusb
          existing files: ok

        decompressing FuguIta-6.7-amd64-202010071.iso.gz...
        9296MiB 0:00:31 [9.51MiB/s] [================================>] 100% ETA 0:00:00
        Now ready to update FuguIta-6.7-amd64-20209041 to FuguIta-6.7-amd64-202010071.

        This machine will reboot immediately after update completed.

        Do you proceed? [y/N] -> y

        stopping all daemons...
        cron(ok)
        ntpd(ok)
        pflogd(ok)
        slaacd(ok)
        smtpd(ok)
        sndiod(ok)
        sshd(ok)
        syslogd(ok)

        overwriting uniprocessor kernel...
        8.66MiB 0:00:06 [1.37MiB/s] [================================>] 100% ETA 0:00:00
        overwriting multiprocessor kernel...
        8.69MiB 0:00:04 [1.84MiB/s] [================================>] 100% ETA 0:00:00
        overwriting filesystem image...
        9864MiB 0:05:30 [3.05MiB/s] [================================>] 100% ETA 0:00:00

        update completed.
        now rebooting...
        syncing disks... done

After completing the update, the PC restarts automatically.

NOTE: If you run fiupdate over a network or on X Window System, the following warning is displayed.


        It seems you are running this script on X Window System,
        via network or something like this.
        In this situation, during update, corresponding processes
        will be killed and then update may fail.

        Running this on direct console device is highly recommended.

        Continue anyway? [y/N] ->
Note : fiupdate stops all daemons before updating the system files. The network will be disconnected and the X session ended and the update would fail.So, fiupdate should be run directly on the console terminal.
 

6.26 FuguIta on a laptop

In order to use FuguIta on a laptop, the basic part does not change
significantly from the operations as a desktop environment.
However, to operate more efficiently by changing and adding settings,
considering the unique characteristics of laptops.
This section explains the power settings for a laptop or notebook PC.

6.27 Power settings for laptop

Current laptop PCs, especially notebook PCs, have a mechanism called ACPI (Advanced Configuration and Power Interface) and APM (Advanced Power Management), and can monitor and control power supplied by the battery. In OpenBSD ACPI is implemented as acpi(4), and apm(4) and can be accessed through system commands. Management of ACPI and APM are controlled by a daemon called apmd(8). Apmd status confirmation and settings can be controlled as follows:

    $ doas -s
    Password:
    # rcctl get apmd
    apmd_class=daemon
    apmd_flags=NO      <=========== APMD is set to not operational
    apmd_timeout=30
    apmd_user=root

Enable apmd.

    # rcctl enable apmd
    # rcctl set apmd flags -A  <======= CPU clock frequency is automatically changed according to CPU load
    # rcctl start apmd
    # rcctl get apmd
    apmd_class=daemon
    apmd_flags=
    apmd_timeout=30
    apmd_user=root
    # 

When finished save using the usbfadm command and restart FuguIta in mode 3. When APMD is running, the command of apm(8) can be used for monitoring.

    $ apm
    Battery state: high, 89% remaining, 57 minutes life estimate
    A/C adapter state: not Connected
    Performance adjustment mode: auto (1000 MHz)

In the following example, the apm command is given the -L flag, so that the CPU always sets the low frequency clock.

    $ apm -l
    $ apm
    Battery state: high, 88% remaining, 42 minutes life estimate
    A/C adapter state: not connected
    Performance adjustment mode: manual (1000 MHz)

Hardware status, such as batteries, can also be monitored by sysctl and systat(1) commands.

    $ sysctl hw.sensors
    hw.sensors.acpitz0.temp0=55.50 degC (zone temperature)
    hw.sensors.acpiac0.indicator0=Off (power supply)
    hw.sensors.acpibat0.volt0=14.80 VDC (voltage)
    hw.sensors.acpibat0.volt1=15.30 VDC (current voltage)
    hw.sensors.acpibat0.current0=1.19 A (rate)
    hw.sensors.acpibat0.amphour0=1.12 Ah (last full capacity)
    hw.sensors.acpibat0.amphour1=0.21 Ah (warning capacity)
    hw.sensors.acpibat0.amphour2=0.07 Ah (low capacity)
    hw.sensors.acpibat0.amphour3=0.92 Ah (remaining capacity), OK
    hw.sensors.acpibat0.amphour4=2.15 Ah (design capacity)
    hw.sensors.acpibat0.raw0=1 (battery discharging), OK
    hw.sensors.acpibtn0.indicator0=On (lid open)
    hw.sensors.acpidock0.indicator0=Off (not docked), UNKNOWN
    hw.sensors.cpu0.temp0=55.00 degC

    $ systat sensors
        3 users    Load 0.40 0.42 0.37                     Wed Dec 30 04:18:11 2015

    SENSOR                                 VALUE  STATUS  DESCRIPTION
    acpitz0.temp0                     56.50 degC          zone temperature
    acpiac0.indicator0                       Off          power supply
    acpibat0.volt0                    14.80 V DC          voltage
    acpibat0.volt1                    15.26 V DC          current voltage
    acpibat0.current0                     1.08 A          rate
    acpibat0.amphour0                    1.12 Ah          last full capacity
    acpibat0.amphour1                    0.21 Ah          warning capacity
    acpibat0.amphour2                    0.07 Ah          low capacity
    acpibat0.amphour3                    0.90 Ah    OK    remaining capacity
    acpibat0.amphour4                    2.15 Ah          design capacity
    acpibat0.raw0                          1 raw    OK    battery discharging
    acpibtn0.indicator0                       On          lid open
    acpidock0.indicator0                     Off unknown  not docked
    cpu0.temp0                        56.00 degC

The systat command defaults to update the state every 5 seconds and continue displaying. If you enter "q", it will end. apm commands can also be paused. Other commands such as zzz(8) and zzz(8) can also be used to enter into hibernation. The method of recovering from hibernation varies from model to model, but many of them require a short press of the power button or pressing the hibernation key again.



NOTE: If you perform standby, sleep or hibernate, the USB device is disconnected and reconnected at the time of recovery from sleep. Therefore, please be aware that the LiveUSB version FuguIta mounted on the USB device will not be working properly after the system returns from sleep. Depending on the model of the PC, it is not possible to restart from suspended or hibernated state, Please check before using any standby mode when running FuguIta from USB drive.

When using X, you can control the display with the XSET command. Add the following line in .xinitrc in the home directory;

    xset s on   <==== Enable screensaver
    xset s 180   <===== Screensaver operation start time (seconds)
    xset +dpms   <=====  Display to Power saving mode

If this example, the display goes into power saving mode if the mouse or keyboard inputs do not occur for more than 180 seconds.

 

6.28 Switching and using multiple network settings

Network settings are set in several files in the /etc directory as described in the Network Preferences, but FuguIta allows you to generate those files by using the command named gennetconfs. You can also have multiple network settings and you can switch from one to another using the command chnetconf.

In FuguIta, network-related configuration files are stored in the subdirectory under /etc/netconfs, and from /etc, symbolic links are connected to those files. The settings made by initial boot are in /etc/netconfs/default.

        # cd / etc

        # ls -l | grep netconfs
        lrwxr-xr-x  1 root  wheel        27 May 12 00:49 hosts -> /etc/netconfs/default/hosts
        lrwxr-xr-x  1 root  wheel        28 May 12 00:49 myname -> /etc/netconfs/default/myname
        drwxr-xr-x  3 root  wheel        48 May 12 00:49 netconfs
        lrwxr-xr-x  1 root  wheel        33 May 12 00:49 resolv.conf -> /etc/netconfs/default/resolv.conf
        lrwxr-xr-x  1 root  wheel        33 May 12 00:49 sysctl.conf -> /etc/netconfs/default/sysctl.conf
        # ifconfig
        lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
               index 3 priority 0 llprio 3
               groups: lo
               inet6 ::1 prefixlen 128
               inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
               inet 127.0.0.1 netmask 0xff000000
        msk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
               lladdr 00:17:42:6b:8a:92
               index 1 priority 0 llprio 3
               groups: egress
               media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
               status: active
        enc0: flags=0<>
               index 2 priority 0 llprio 3
               groups: enc
               status: active
        run0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
               lladdr cc:e1:d5:15:0e:cb
               index 4 priority 4 llprio 3
               groups: wlan
               media: IEEE802.11 autoselect (DS1 mode 11g)
               status: no network
               ieee80211: nwid ""
        pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
               index 5 priority 0 llprio 3
               groups: pflog 

As an example, let's add two settings called Home for working at "home" and "office" for office work. First of all, from "office". It connects to ethernet and assumes use in fixed address settings. To add a new setting, create a directory below /etc/netconfs.

    # cd /etc/netconfs
    # ls -l
    total 8
    drwxr-xr-x 2 root wheel 192 May 12 00:41 default
    # mkdir office

Use the conventional gennetconfs utility to create configuration files. The method of use is the same as the setting performed with activation mode 0, 1, 2.

    # cd office
    # gennetconfs
    host name (without domain) -> fuguita
    IP version(s) to use: 4, 6, 46, 64 or n
      46: IPv4 preferred over IPv6 in address resolution
      64: reversed to 46
       n: stand alone operation
    [46]-> 4
    ==[ifconfig -a]=========================
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
           index 3 priority 0 llprio 3
           groups: lo
           inet6 ::1 prefixlen 128
           inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
           inet 127.0.0.1 netmask 0xff000000
    msk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
           lladdr 00:17:42:6b:8a:92
           index 1 priority 0 llprio 3
           groups: egress
           media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
           status: active
    enc0: flags=0<>
           index 2 priority 0 llprio 3
           groups: enc
           status: active
    run0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
           lladdr cc:e1:d5:15:0e:cb
           index 4 priority 4 llprio 3
           groups: wlan
           media: IEEE802.11 autoselect (DS1 mode 11g)
           status: no network
           ieee80211: nwid ""
    pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
           index 5 priority 0 llprio 3
           groups: pflog
    ========================================
    Available network interface(s): msk0 run0
    network interface to setup [msk0] -> msk0
    FQDN of this host -> fuguita.office.local
    DNS setup;
      Manual : Enter up to three IPv4/IPv6 addresses, separated by spaces
      DHCP  : Just press ENTER .
      no DNS : Enter "none".
    -> 192.168.20.254
    IPv4 addr of this host -> 192.168.20.115
    netmask                -> 255.255.255.0
    default route          -> 192.168.20.254

When the setting by gennetconfs is complete, a configuration file is created in the subdirectory you created

    # ls -l
    total 48
    -rw-r-----  1 root  wheel   37 May 12 01:14 hostname.msk0
    -rw-r--r--  1 root  wheel   82 May 12 01:14 hosts
    -rw-r--r--  1 root  wheel   12 May 12 01:14 mygate
    -rw-r--r--  1 root  wheel   21 May 12 01:14 myname
    -rw-r--r--  1 root  wheel   73 May 12 01:14 resolv.conf
    -rw-r--r--  1 root  wheel  106 May 12 01:14 sysctl.conf
    # ls -l /etc/ | grep netconfs
    lrwxr-xr-x  1 root  wheel        27 May 12 00:49 hosts -> /etc/netconfs/default/hosts
    lrwxr-xr-x  1 root  wheel        28 May 12 00:49 myname -> /etc/netconfs/default/myname
    drwxr-xr-x  4 root  wheel        96 May 12 01:13 netconfs
    lrwxr-xr-x  1 root  wheel        33 May 12 00:49 resolv.conf -> /etc/netconfs/default/resolv.conf
    lrwxr-xr-x  1 root  wheel        33 May 12 00:49 sysctl.conf -> /etc/netconfs/default/sysctl.conf

Use the chnetconf utility to show these settings. When chnetconf is executed, the /etc/netstart is run internally and changing the settings after the symbolic link is created from /etc to these files.

    # chnetconf
    16.0K  default
    28.0K  office
    # chnetconf office
    # ls -l /etc/ | grep netconfs
    lrwxr-xr-x  1 root  wheel        34 May 12 01:15 hostname.msk0 -> /etc/netconfs/office/hostname.msk0
    lrwxr-xr-x  1 root  wheel        26 May 12 01:15 hosts -> /etc/netconfs/office/hosts
    lrwxr-xr-x  1 root  wheel        27 May 12 01:15 mygate -> /etc/netconfs/office/mygate
    lrwxr-xr-x  1 root  wheel        27 May 12 01:15 myname -> /etc/netconfs/office/myname
    drwxr-xr-x  4 root  wheel        96 May 12 01:13 netconfs
    lrwxr-xr-x  1 root  wheel        32 May 12 01:15 resolv.conf -> /etc/netconfs/office/resolv.conf
    lrwxr-xr-x  1 root  wheel        32 May 12 01:15 sysctl.conf -> /etc/netconfs/office/sysctl.conf
    # ifconfig
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
           index 3 priority 0 llprio 3
           groups: lo
           inet6 ::1 prefixlen 128
           inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
           inet 127.0.0.1 netmask 0xff000000
    msk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
           lladdr 00:17:42:6b:8a:92
           index 1 priority 0 llprio 3
           groups: egress
           media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
           status: active
           inet 192.168.20.115 netmask 0xffffff00 broadcast 192.168.1.255
    enc0: flags=0<>
           index 2 priority 0 llprio 3
           groups: enc
           status: active
    run0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
           lladdr cc:e1:d5:15:0e:cb
           index 4 priority 4 llprio 3
           groups: wlan
           media: IEEE802.11 autoselect (DS1 mode 11g)
           status: no network
           ieee80211: nwid ""
    pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
           index 5 priority 0 llprio 3
           groups: pflog
    # ping www.google.com
    PING www.google.com (172.217.175.68): 56 data bytes
    64 bytes from 172.217.175.68: icmp_seq=0 ttl=115 time=28.318 ms
    64 bytes from 172.217.175.68: icmp_seq=1 ttl=115 time=25.842 ms
    64 bytes from 172.217.175.68: icmp_seq=2 ttl=115 time=26.137 ms
    ^C
    --- www.google.com ping statistics ---
    3 packets transmitted, 3 packets received, 0.0% packet loss
    round-trip min/avg/max/std-dev = 25.842/26.765/28.318/1.104 ms

Subsequently, let's create a setting for "home". This is assumed to use DHCP on WiFi connection.

    # pwd
    /etc/netconfs/office
    # mkdir /etc/netconfs/home
    # cd /etc/netconfs/home
    # gennetconfs
    host name (without domain) -> fuguita
    IP version(s) to use: 4, 6, 46, 64 or n
      46: IPv4 preferred over IPv6 in address resolution
      64: reversed to 46
       n: stand alone operation
    [46]-> 46
    ==[ifconfig -a]=========================
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
           index 3 priority 0 llprio 3
           groups: lo
           inet6 ::1 prefixlen 128
           inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
           inet 127.0.0.1 netmask 0xff000000
    msk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
           lladdr 00:17:42:6b:8a:92
           index 1 priority 0 llprio 3
           groups: egress
           media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
           status: active
           inet 192.168.20.115 netmask 0xffffff00 broadcast 192.168.1.255
    enc0: flags=0<>
           index 2 priority 0 llprio 3
           groups: enc
           status: active
    run0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
           lladdr cc:e1:d5:15:0e:cb
           index 4 priority 4 llprio 3
           groups: wlan
           media: IEEE802.11 autoselect (DS1 mode 11g)
           status: no network
           ieee80211: nwid ""
    pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
           index 5 priority 0 llprio 3
           groups: pflog
    ========================================
    Available network interface(s): msk0 run0
    network interface to setup [msk0] -> run0
    FQDN of this host -> fuguita.home.local
    Wi-Fi SSID -> WIFI-SSID
       WPA Key -> WPA-PASSWD
    DNS setup;
      Manual : Enter up to three IPv4/IPv6 addresses, separated by spaces
      DHCP  : Just press ENTER .
      no DNS : Enter "none".
    ->
    # ls -l
    total 40
    -rw-r-----  1 root  wheel   59 May 12 01:29 hostname.run0
    -rw-r--r--  1 root  wheel   76 May 12 01:29 hosts
    -rw-r--r--  1 root  wheel   19 May 12 01:29 myname
    -rw-r--r--  1 root  wheel    0 May 12 01:29 resolv.conf
    -rw-r--r--  1 root  wheel   54 May 12 01:29 resolv.conf.tail
    -rw-r--r--  1 root  wheel  106 May 12 01:29 sysctl.conf
    # chnetconf
    16.0K  default
    24.0K  home
    28.0K  office
    # chnetconf home
    run0: no link....got link
    run0: 192.168.10.61 lease accepted from 192.168.10.231 (f8:b7:97:2d:89:66)
    # ifconfig
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
           index 3 priority 0 llprio 3
           groups: lo
           inet6 ::1 prefixlen 128
           inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
           inet 127.0.0.1 netmask 0xff000000
    msk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
           lladdr 00:17:42:6b:8a:92
           index 1 priority 0 llprio 3
           media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
           status: active
    enc0: flags=0<>
           index 2 priority 0 llprio 3
           groups: enc
           status: active
    run0: flags=248843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF6TEMP,AUTOCONF6> mtu 1500
           lladdr cc:e1:d5:15:0e:cb
           index 4 priority 4 llprio 3
           groups: wlan egress
           media: IEEE802.11 autoselect (DS1 mode 11g)
           status: active
           ieee80211: nwid WIFI-SSID chan 11 bssid 1c:b1:7f:27:5c:de -61dBm wpakey wpaprotos wpa2 wpaakms psk
           wpaciphers ccmp wpagroupcipher ccmp
           inet 192.168.10.61 netmask 0xffffff00 broadcast 192.168.10.255
           inet6 fe80::cee1:d5ff:fe15:ecb%run0 prefixlen 64 scopeid 0x4
           inet6 2409:xx:xxxx:xxxx:669c:3666:1e5d:1e95 prefixlen 64 autoconf pltime 604797 vltime 2591997
           inet6 2409:xx:xxxx:xxxx:ded5:bc35:e07a:fa89 prefixlen 64 autoconf temporary pltime 84961 vltime 172794
    pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
           index 5 priority 0 llprio 3
           groups: pflog

Now three network settings have been created, including defaults. These settings can be changed at any time using the chnetconf utility.

6.29 Using a WiFi Device that needs Firmware Download

This section describes how to introduce WiFi devices with the gennetconfs command. OpenBSD supports various WiFi devices, but there are devices that require a firmware download and installation before it can be used.

NOTE: The following description is available to the OpenBSD site for cases that require firmware download; OpenBSD FAQ-Wireless Networking: https://www.openbsd.org/faq/faq6.html#Wireless: In order to use some wireless cards, you will need to acquire firmware files with fw_update(1). Some manufacturers refuse to allow free distribution of their firmware, so it can't be included with OpenBSD.

Therefore, in order to use these WiFi devices, FuguIta is first connected to the Internet by ethernet (wired connection), and the firmware download is performed, and then the network setting is changed for the desired WiFi device.

Here are the steps to explain the procedure.

1. Connect FuguIta to the internet If possible use a working WiFi device, or wired LAN for firmware download

2. Firmware download and installation. If FuguIta is connected to the Internet at startup, you will automatically download and install the required firmware for the devices on the PC. If not automatic download happens, start the fw_update command manually and verify that the firmware is installed.

    # fw_update -v
    Path to firmware: http://firmware.openbsd.org/firmware/6.3/
    Updating: wpi-firmware-3.2p1 intel-firmware-20180312v0
    Checking packages|No change in wpi-firmware-3.2p1
    No change in intel-firmware-20180312v0
    #

3. Change network settings for WiFi devices Execute the gennetconfs command and rewrite the network settings for WiFi.

    # cd /etc/netconfs/default
    # gennetconfs
    host name (without domain) -> fugu-demo
    IP version(s) to use: 4, 6, 46, 64 or n
      46: IPv4 preferred over IPv6 in address resolution
      64: reversed to 46
       n: stand alone operation
    [46]->
    '46' selected as default
    ==[ifconfig -a]=========================
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
        index 4 priority 0 llprio 3
        groups: lo
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
    wpi0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:1b:77:01:4e:fe
        index 1 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect
        status: no network
        ieee80211: nwid ""
    em0: flags=208a43<UP,BROADCAST,RUNNING,ALLMULTI,SIMPLEX,MULTICAST,AUTOCONF6> mtu 1500
        lladdr 00:19:b9:6c:60:dd
        index 2 priority 0 llprio 3
        groups: egress
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 192.168.10.94 netmask 0xffffff00 broadcast 192.168.10.255
        inet6 fe80::eeef:ccc9:98bb:7824%em0 prefixlen 64 scopeid 0x2
    enc0: flags=0<>
        index 3 priority 0 llprio 3
        groups: enc
        status: active
    pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
        index 5 priority 0 llprio 3
        groups: pflog
    ========================================
    Available network interface(s): wpi0 em0
    network interface to setup [wpi0] -> wpi0
    FQDN of this host -> fugu-demo.localnet
    Wi-Fi SSID -> my-wifi-ssid
       WPA Key -> my-wpa-passphrase
    DNS setup;
      Manual : Enter up to three IPv4/IPv6 addresses, separated by spaces
      DHCP   : Just press ENTER .
      no DNS : Enter "none".
    ->
 #

3. Save and restart after saving the changes to settings use the usbfadm command, and restart FuguIta in mode 3.

7. Use FuguIta [Development]

This chapter provides information to understand the basics of FuguIta and to develop software on FuguIta.

7.1 Technical information for FuguIta

Because FuguIta is based on OpenBSD, most of the components can be used using OpenBSD information. For part of the official OpenBSD, there is a list of published materials on the top page of the download site for different FuguIta images, so please refer to it.

7.2 Developing on FuguIta

Since FuguIta keeps all files in memory, it does not cause any errors in the file system even if the power is turned off without a proper shutdown operation. Also, unless you save files by usbfadm during operation, the system will reboot in the previous state. Using this feature, you can create a dedicated machine to run a specific application based on FuguIta.

In order to build such a system, we will use the methods described so far. First, the operating environment is adjusted. Start up at activation mode 0, install various settings and applications, etc., and build an environment to operate. Save the configured environment in usbfadm in USB memory etc. Start with mode 3 and set the noasks file to start up in the saved environment. Edit the ttys(5) file so that the application opens without login operation.

7.3 Make an ISO image from a running FuguIta

By installing FuguIta to match the capacity of the USB drive we created an ISO image file of LiveUSB. Now we will explain how to create an ISO image of FuguIta in operation by using the remaster_dvd.sh command.

NOTE: Since this process deals with large files, the size of the tmpfs has to be more than two gigabytes. If you do not have enough memory for tmpfs, you have to mount another external storage device.

The script remasterdvd.sh is available either on FuguIta LiveDVD or FuguIta LiveUSB. The following example illustrates the use of remasterdvd.sh.

First, create a working directory and copy the contents of the LiveDVD or LiveUSB under the /sysmedia directory to that working directory.

    # mkdir work
    # cd work
    # 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
    # ls -l
    total 8
    drwxr-xr-x  3 root  wheel  432 May 11 09:21 sysmedia

Run the remaster_dvd.sh in copied sysmedia directory.

    # cd sysmedia
    # 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
    # remaster_dvd.sh
    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)

When the execution of the remaster_dvd.sh is complete, you have an ISO image file is created in the working directory.

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

There is a file named fuguita-6.9-amd64.ffsimg in sysmedia, which contains the FuguIta file tree. You can customize LiveDVD by modifying the files in this file tree.

    # vnconfig vnd0 fuguita-6.9-amd64.ffsimg
    # mount /dev/vnd0a /mnt
    # 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 customisation is complete, close the file system image and remaster.

    # umount /mnt
    # vnconfig -u vnd0
    # remaster_dvd.sh
    mkhybrid 1.12b5.1
    Scanning .
    Scanning ./etc

7.4 Customization and Creation of FuguIta LiveDVD

You can customize FuguIta and create your own live system by using FuguIta's building tool. This section explains how to build LiveDVD. When creating a LiveUSB, create a LiveUSB ISO image file in the method described and create a disk image of FuguIta in the next section.



7.5 Before starting your work

What you need:



Working conditions



We will explain the creation procedure with examples in the next section.

This example assumes OpenBSD 6.7 as the target version and amd64 as the platform.

The directory where the building tools are placed is referred to as FI_BUILD_PATH.

Please replace this part with the actual directory path.

7.6 Kernel Source Tree Setup

Get and expand the kernel source tree from the OpenBSD distribution site

    # cd /usr/src
    # ftp http://ftp.jaist.ac.jp/pub/OpenBSD/6.7/sys.tar.gz
    Trying 150.65.7.130...
    Requesting http://ftp.jaist.ac.jp/pub/OpenBSD/6.7/sys.tar.gz
    100% |**************************************************| 31438 KB  - 01:55 ETA
    32193241 bytes received in 115.84 seconds (271.39 KB/s)
    # tar xzf sys.tar.gz
    # 

Update kernel source tree using Anonymous CVS

    # cd sys
    # cvs -qd anoncvs@anoncvs.jp.openbsd.org:/cvs update -Pd -rOPENBSD_6_7
    The authenticity of host 'anoncvs.jp.openbsd.org (133.45.178.239)' can't be established.
    ECDSA key fingerprint is SHA256:aXpmw11DuXXLm8PsJ37L65jEXbu8JF2cnVfQptSkoyQ.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added 'anoncvs.jp.openbsd.org,133.45.178.239' (ECDSA) to the list of known hosts.
    P conf/newvers.sh
    P dev/hid/hid.c
    ~ omitted ~
    P kern/tty_pty.c
    P sys/tty.h
    #

For more information on Source Tree updates using Anonymous CVS, please refer to the OpenBSD official site.

up

7.7. FuguIta Development tool Setup

Get a development tool from the FuguIta distribution site.

    # cd FI_BUILD_PATH
    # ftp https://jp1.dl.fuguita.org/tools/tools-6.7-amd64.tar.xz
    Trying 110.92.1.224...
    Requesting https://jp1.dl.fuguita.org/tools/tools-6.7-amd64.tar.xz
    100% |**************************************************|  3599 KB    00:04 ETA
    3685508 bytes received in 4.87 seconds (738.66 KB/s)
    #

The development tool file is compressed in xz format, so install the xz utility from the xz package.

    # pkg_add xz
    quirks-3.326 signed on 2020-09-04T21:31:39Z
    xz-5.2.5:ok
    #

Expand the Tool to FI_BUILD_PATH .

    # xz -dc tools-6.7-amd64.tar.xz | tar xvf -
    tools-6.7-amd64
    tools-6.7-amd64/.cvsignore
    ~ omitted ~
    tools-6.7-amd64/sys/uvm/uvm_vnode.h
    tools-6.7-amd64/sys/uvm/uvmexp.h
    #

7.8 Generation of kernel for FuguIta

The kernel source tree in the build tool is a symbolic link (shadow copy) to the actual kernel source tree under /usr/src/sys. We will rebuild this shadow copy.

    # cd tools-6.7-amd64
    # rm -r sys
    # mkdir sys
    # cd sys
    # lndir /usr/src/sys
    /usr/src/sys/arch:
    /usr/src/sys/arch/alpha:
    ~ omitted ~
    /usr/src/sys/ufs/ufs:
    /usr/src/sys/uvm:
    # 

Run the config command.

    # cd arch/amd64/conf
    # ln -s FI_BUILD_PATH/tools-6.7-amd64/lib/RDROOT.amd64 RDROOT
    # ln -s FI_BUILD_PATH/tools-6.7-amd64/lib/RDROOT.MP.amd64 RDROOT.MP
    # config RDROOT
    making FI_BUILD_PATH/tools-6.7-amd64/sys/arch/amd64/compile/RDROOT/obj
    config  -b FI_BUILD_PATH/tools-6.7-amd64/sys/arch/amd64/compile/RDROOT/obj
    -s FI_BUILD_PATH/tools-6.7-amd64/sys FI_BUILD_PATH/tools-6.7-amd64/sys/arch/amd64/conf/RDROOT
    # config RDROOT.MP
    making FI_BUILD_PATH/tools-6.7-amd64/sys/arch/amd64/compile/RDROOT.MP/obj
    config  -b FI_BUILD_PATH/tools-6.7-amd64/sys/arch/amd64/compile/RDROOT.MP/obj
    -s FI_BUILD_PATH/tools-6.7-amd64/sys FI_BUILD_PATH/tools-6.7-amd64/sys/arch/amd64/conf/RDROOT.MP
    #

Compile a single-processor kernel.

    # cd ../compile/RDROOT
    # make clean && make
    rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.*  gap.link gapdummy.c ld.script lorder makegap.sh param.c
    cp FI_BUILD_PATH/tools-6.7-amd64/sys/conf/makegap.sh makegap.sh
    echo '__asm(".section .rodata,\"a\"");' > gapdummy.c
    cc -g -Werror -Wall -Wimplicit-function-declaration  -Wno-uninitialized -Wno-pointer-sign ...
    
    cc -g -Werror -Wall -Wimplicit-function-declaration  -Wno-uninitialized -Wno-pointer-sign ...
    LD="ld" sh makegap.sh 0xcccccccc gapdummy.o
    ld -T ld.script -X --warn-common -nopie -o bsd ${SYSTEM_HEAD} vers.o ${OBJS}
    text    data    bss     dec     hex
    15637669        2316936 704512  18659117        11cb72d
    mv bsd bsd.gdb
    ctfstrip -S -o bsd bsd.gdb
    #

Compile the multiprocessor kernel.

    # cd ../RDROOT.MP/
    # make clean && make
    rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.*  gap.link gapdummy.c ld.script lorder makegap.sh param.c
    cp FI_BUILD_PATH/tools-6.7-amd64/sys/conf/makegap.sh makegap.sh
    echo '__asm(".section .rodata,\"a\"");' > gapdummy.c
    cc -g -Werror -Wall -Wimplicit-function-declaration  -Wno-uninitialized -Wno-pointer-sign ...
    cc -g -Werror -Wall -Wimplicit-function-declaration  -Wno-uninitialized -Wno-pointer-sign ...
    LD="ld" sh makegap.sh 0xcccccccc gapdummy.o
    ld -T ld.script -X --warn-common -nopie -o bsd ${SYSTEM_HEAD} vers.o ${OBJS}
    text    data    bss     dec     hex
    15722042        2317408 712704  18752154        11e229a
    mv bsd bsd.gdb
    ctfstrip -S -o bsd bsd.gdb
    #

7.9 Update RAM Disk Root File System (RDROOT)

Replace the contents of the RDROOT of the development tool with the latest one which the build system is working on.

    # cd FI_BUILD_PATH/tools-6.7-amd64
    # make open-rdroot
    vnconfig vnd0 rdroot.img
    mount /dev/vnd0a rdroot
    # cd /boottmp/
    # rsync -avH --delete . .FI_BUILD_PATH/tools-6.7-amd64/rdroot/boottmp
    sending incremental file list
    ./
    boot_livecd_rc_ends
    boot_mode
    boot_partitions
    boot_restore_devname
    boot_starts
    boot_tries
    boot_user_config
    dtjsetup
    fstab
    rc
    usbfadm
    CVS/
    CVS/Entries

    sent 94,504 bytes  received 255 bytes  63,172.67 bytes/sec
    total size is 15,863,539  speedup is 167.41
    # cd FI_BUILD_PATH/tools-6.7-amd64/rdroot/boottmp

The BOOT_* files are generated at the boot time of FuguIta.
It is unnecessary and will be removed.

    # rm boot_*
    # cd ../..
    # make close-rdroot
    umount rdroot
    vnconfig -u vnd0
    # 

7.10 Write the file tree of FuguIta

The build tool does not include the file tree of the FuguIta itself, so write the one of FuguIta that the build system is working on.

    # make open-media
    vnconfig vnd1 media.img
    mount /dev/vnd1a media
    # make open-fuguita
    vnconfig vnd2 media/fuguita-6.7-amd64.ffsimg
    mount /dev/vnd2a fuguita
    # cd /fuguita/
    # pax -rwvpe . FI_BUILD_PATH/tools-6.7-amd64/fuguita
    FI_BUILD_PATH/tools-6.7-amd64/fuguita/.
    FI_BUILD_PATH/tools-6.7-amd64/fuguita/./usr
    ~ omitted ~
    FI_BUILD_PATH/tools-6.7-amd64/fuguita/./.cshrc
    FI_BUILD_PATH/tools-6.7-amd64/fuguita/./.profile
    # 

7.11 Customise FuguIta

Enter within the "fuguita" directory and create the customization you want to do. If it is a simple file operation (file copy and edit), you do not need to do chroot command.

    # cd FI_BUILD_PATH/tools-6.7-amd64
    # chroot fuguita /bin/ksh -l
    # ~ (customise work) ~
       :
       :
    # exit
    # make close-fuguita
    umount fuguita
    vnconfig -u vnd2
    # 

7.12 Bootloader and kernel setup

Write the image of the RAM disk file system previously updated with the kernel. Boot loader for DVD and kernel are in the ISO file system.

    # make boot
    cp bsd.orig bsd
    rdsetroot bsd rdroot.img
    gzip -c9 bsd > media/bsd-fi
    cp bsd.mp.orig bsd.mp
    rdsetroot bsd.mp rdroot.img
    gzip -c9 bsd.mp > media/bsd-fi.mp
    cp lib/cdbr lib/cdboot media/.
    [ -d media/etc ] || mkdir media/etc
    cp lib/boot.conf media/etc/.
    : '[ -d media/sbin ] || mkdir media/sbin'
    : 'cp -p /sbin/vnconfig media/sbin; strip media/sbin/vnconfig'
    : '/usr/mdec/installboot -v media/boot /usr/mdec/biosboot vnd1'
    # 

7.13 Creating an ISO image file for distribution

Convert the file tree to write it to an ISO file system and into an ISO image file.

    # make hyb
    make open-fuguita
    vnconfig vnd2 media/fuguita-6.7-amd64.ffsimg
    mount /dev/vnd2a fuguita
    echo "6.7-amd64-20200907$((0+1))" > fuguita/usr/fuguita/version
    make close-fuguita
    umount fuguita
    vnconfig -u vnd2
    mkhybrid -a -R -L -l -d -D -N  -o livecd.iso  -v -v  -A "FuguIta - OpenBSD Live System"
    -P "Copyright (c) `date +%Y` KAWAMATA Yoshihiro"  -p "KAWAMATA Yoshihiro, http://fuguita.org/"
    -V "FuguIta-6.7-amd64-20200907$((0+1))"  -b cdbr  -c boot.catalog  media  && echo $((0+1)) > revcount_cdmaster
    mkhybrid 1.12b5.1
    Scanning media
    Scanning media/etc

    Size of boot image is 4 sectors -> No-emulation CD boot sector
    Total translation table size: 0
    Total rockridge attributes bytes: 1035
    Total directory bytes: 2048
    Path table size(bytes): 22
    466757 extents written (911 Mb)
    # make close-media
    umount media
    vnconfig -u vnd1
    #

Compress the generated ISO image file with a given file name.

    # make cdgz
    ln livecd.iso FuguIta-6.7-amd64-202009071.iso
    gzip -v9 FuguIta-6.7-amd64-202009071.iso
    FuguIta-6.7-amd64-202009071.iso:  67.7% -- replaced with FuguIta-6.7-amd64-202009071.iso.gz
    955918336 bytes in, 309095869 bytes out
    # 

7.14 Makefile target list

The argument of the make command (target) used in the ISO image construction of FuguIta is as follows. All these must be done on directory FI_BUILD_PATH/tools-6.7-amd64 .

    make target    action
    open-rdroot    mount the file system in rdroot.img to rdroot
    open-media     mount the filesystem in media.img to media
    open-fuguita   mount the file system in media/fuguita-*-*.ffsimg
                   to fuguita (you need to do make open-media beforehand)
    close-rdroot   unmount the rdroot
    close-media    dismount media (you need to do make close-fuguita beforehand)
    close-fuguita  unmount fuguita
    close-all      unmount all mounts in the build environment
    boot           include rdroot in the kernel and copy it into the ISO contents
    hyb            convert ISO contents to an ISO image file
    cdgz           compress an ISO image file

7.15 Make a disk image of FuguIta

This section introduces how to create LiveUSB disk image files by running 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
    ============================================================
    Enter the name of device which FuguIta will be installed->vnd0    <=====Specify unused vnode device

    Enter size of a vnode device file.
    You can add suffix K, M, G or T (otherwise considered 'bytes').
    ->2g  <=====Specify size of the image file

    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)
    ->
    ~ omitted ~
    ** Phase 5 - Check Cyl groups
    3 files, 3 used, 386996 free (20 frags, 48372 blocks, 0.0% fragmentation)

    ? : ? ->bye

    Bye bye
    $

The disk image file is created on the current directory with the above operation. The file name is the same as that distributed, "FuguIta-OPENBSD_VERSION-PLATFORM-RELEASE.img"

8 ...and finally

FuguIta is aimed at being the "Swiss Army knife in IT".

In other words, it can be carried easily and can be used for various applications'. For normal operation, it is easy for beginners to use it immediately without any preliminary knowledge.




NOTE
FuguIta is based and supported by the outstanding design and implementation of OpenBSD.
We would like to thank Theo de Raadt and other members of the OpenBSD development community for their many years of work on OpenBSD.
We would also like to thank the people involved in the various free software applications included in FuguIta, as well as the people in the various user communities.
In particular, the members of EBUG (Echigo BSD Users Group) are grateful for the provision of the distribution site and various suggestions and advice.
Without these, I think it would have been impossible to continue development for now more than 10 years.
We look forward to your continued support and use of FuguIta.
December 30, 2015 Yoshihiro Kawamata
Created December 30, 2015, Revised January 15, 2017, August 1, 2018, August 8, 2018, January 15,2019, May 10, 2019, March 25, 2019, November 3, 2019, February 7,2020, June 15, 2020, September 7, 2020, September 7, 2020, October 10, 2020, February 17, 2021, June 2, 2021.
Translated to English by Alfredo Vogel, October 2021, with help and thanks to “Google Translate” for first round into EN.All errors and omissions are exclusively mine and if you are in doubt or need help visit theFuguIta BBS at http://fuguita.org/index.php?FuguIta%2FBBS