Installing Big-endian FreeBSD

From RCS Wiki
Jump to navigation Jump to search

This tutorial is a step-by-step guide to installing Big-endian FreeBSD. It largely follows the default options, but notes where alternatives can be entered. It also highlights pitfalls and solutions.

What is known to not work is device discovery after installation, and autoboot. Solutions to the former and diagnostic information on the latter are presented.

OpenBMC Part 1

Virtual Media

For this installation, big-endian FreeBSD was obtained from the FreeBSD official powerpc64 ISO RELEASE repository. They also have a little-endian release.

If you do not have direct access to the machine, you can use the Virtual Media interface.

Virtual media interface.png

Choose a local file for the installation. There is no option for choosing a file on a remote server. In this case the big-endian FreeBSD installer is selected.

Virtual media.png

Serial over LAN

To interact with petitboot, select Serial over LAN from the Server Control menu

Serial over LAN menu.png

While booting, you should see output such as

Serial over LAN out.png

Note that by default, the window area might not be selected. Click into the console area to activate it.

Selecting the FreeBSD Installer

Once you have booted, the first stop is the boot menu.

After reboot.png

Using the arrow keys, select "FreeBSD Installer" and hit 'enter'

Petitboot select installer.png

The system will reboot into the FreeBSD system on the installer iso.

Freebsd img initial output.png

FreeBSD Installer

Console selection and Welcome!

After the boot process is nearly complete, you will need to select the console type.

Selecting console.png

The next message should be the installer interface:

Installer landing.png

If you would like to explore FreeBSD before installing it, select "Shell" or "Live System." Otherwise, select the default "Install" option.

Keymap

You will need to select a keymap. For most English installations, the default will work. Many others are provided.

Keymap.png

Naming the host

Enter a name for the host. In our case, we entered "FreeBSD_BE" to identify this installation as "Big endian," as opposed to the little-endian version maintained by Raptor.

Name the host.png

Selecting components

Select the components you want installed. To select or de-select, navigate to the option with the arrow keys and hit the space bar. Hitting the 'return' key will accept the entries. For this installation, we have additionally selected the ports tree and the source code.

Select components.png

Partitioning the disk

The default destination disk might come up opalflash0. This is a read-write RAM disk provided by petitboot. Do not select it. Choose an alternative that looks reasonable or expected. In this case, the NVMe disk will be identified as nda0.

Destination disk.png

The installer will present you with options for partitioning. Unless you have specific needs and can manage those yourself, choose the Auto/Guided UFS Setup option.

Partitioning.png

Unless you have need to partition the disk (perhaps to support additional installations), use the entire disk. You may be given a warning about erasing previous partitions, or using the entire partition.

Entire disk.png

Select GPT.

GPT.png

You can make some last minute changes in the partition map editor.

Partition editor.png

And one last chance to not erase the disk:

Last chance.png

Verifying components

Upon successful partitioning of the destination disk, the installer will begin to download the previously selected components. Since this connection is from your local computer to the host, the length of time this takes is entirely dependent on your internet connection.

Verifying components.png

Root password

If all has gone well, the next prompt will ask you to enter a password for the root account. The default setting in FreeBSD is not allow remote logins with root; only console logins are accepted.

Root password.png

Network interface

Your Talos II system has two ethernet interfaces. We are selecting bge0.

Network interface.png

This system is hosted by Raptor; the values are from their network. Enter yours as appropriate. If you do not want to manually enter the values, select DHCP (not shown).

Interface configuration.png

We configured IPv4, but do not want to configure IPv6 for this example.

Ipv6.png

Last, enter your choices for DNS lookup servers. We have entered two from OpenDNS.

Opendns.png

Additional services

The installer allows you to select some basic startup services. We would like ntpd to run.

Additional services.png

Hardening the installation

There are several options for hardening the installation. As this is a development-focused machine, we are not activating any at this time.

Hardening.png

Firmware

For some hardware, FreeBSD has components to work with the firmware and will ask you to install them.

Firmware.png

There are none for this hardware, so you do not need to do anything except hit "enter."

No firmware.png

Additional users

Add users.png

It is a good idea to add at least one additional user at this time. The step-by-step process is guided and omitted here. the final setting might look like:

Additional user.png

In this example, we created a "user1" account, but locked it out. For actual installations, it is advisable to have a user that is added to the "wheel" group. This will allow that user to su to root from an ssh session. Note that user1 has id 1002; we added the wheel group member earlier.

Configuration Review

The installer has collected the installation details and offers a chance to modify your choices.

Configuration review.png

Final Tweaks

You may have some custom settings not covered by the installer. This is when you can apply them, via the shell.

Final tweaks.png

Rebooting

With everything complete, you can reboot, shutdown, or launch a Live System.

Complete time to reboot.png

OpenBMC Part 2

Making nda0 bootable

Upon rebooting, you are going to find yourself back in petitboot.

After reboot.png

Unfortunately, at the time of this writing, there are a few issues that prevent autoboot from working. Further details are found in the #Troubleshooting section below. For now, at the above menu, type 'n' to add a new device:

New device.png

Select the destination disk (use arrow keys to navigate and space bar to choose), and enter '/kernel/kernel' in the kernel location. Navigate to "OK" and type enter. If all has gone well, and you still have the FreeBSD installer CD in the Virtual Media, it should look like:

Post-user item.png

Navigate to "user item 1" and type enter.

FreeBSD boot

Selecting root device

However, you will likely stall partially through the boot process:

Mount root.png

The syntax once in mount is different than if you pass arguments via the command line. Enter "ufs:nda0p2" to mount the second partition (/) and hit "return/enter."

If all goes well, you should see

Success.png

Troubleshooting

Lots of time things don't go so well, and below are some tips for trying figure out why not.

Accessing pb-discover.log

Many of the errors are actually logged. This file is at /var/log/petitboot/pb-discover.log

Pb-discover.log.png

It can be accessed by selecting "Exit to shell" and then basic utilities are available as found in buildroot.

In the example above, the error is because the FreeBSD kernel is not at /boot/kernel, it is as /boot/kernel/kernel. As noted in #OpenBMC Part 2, this has to be manually added to the device in order for petitboot to find it.

Mounting UFS disks

In petitboot, it might be necessary to mount the FreeBSD partitions. Linux does not automatically recognize UFS file systems, so the specifics have to be passed to 'mount':

mount -t ufs -o ufstype=ufs2 /dev/nvme0n1p2 /mnt

Mount ufs petitboot.png

This has mounted the / partition of the FreeBSD installation to /mnt.

Note that the boot partition is likely already loaded at /var/petitboot/dev/mnt/* where * is the Linux-derived name for the disk. In the example below, two boot partitions are already mount (read-only), nvme0n1p1 (the actual installation) and sda0 (the virtual media-based iso installer image).

Var petitboot mnt dev.png

If you need to modify files in the boot partition of the installation, in theory you can remount it read-write. However, depending on the file system, journaling may prevent files written by one operating system from persisting when the drive is booted by another.

Autoboot doesn't work

Beats me. Everything is selected. You will have to add the destination disk to the boot drives and navigate to the bottom to "OK" for the changes to be saved.

Autoboot.png

Basically, go back to #OpenBMC Part 2 and follow those steps. The FreeBSD installation hangs up with mount each time, even though the geometry is correct.

Geometry.png

There is no mismatch in /etc/fstab:

Fstab.png

Developer access

Raptor Computing Systems supports many different development models from bare metal access (e.g. kernel hacking) through software development. If you are interested in developing with FreeBSD and would like an account on our system, please email support@ this domain (raptorcs.com) with a description of your interests.