Installing OpenBSD on the Pomera DM250 Writerdeck

A technical guide on installing OpenBSD-current on the Japanese Pomera DM250 writerdeck, including hardware notes and step-by-step installation instructions.
These are my notes and pre-built images for getting OpenBSD-current installed on the Japanese-model Pomera DM250, DM250X, and DM250XY.
Table of Contents
Throat-clearing
Much of my work has not yet been committed upstream so installation currently requires a custom kernel and U-Boot image which are provided here. OpenBSD support is still improving and may not be stable at any given time. Install at your own risk. These risks include:
If the battery completely drains due to a software bug, the device may not power on correctly and will not be able to recharge its battery (see below).
If the device cannot boot properly into U-Boot, you may need to recover it through a USB cable which may also require having to open the device (see recovery).
Note: Do not use these instructions for the US-model DM250US yet. That device has a different power charging chip and keyboard layout.
Making a backup
This is optional but recommended. The tools and instructions at EKESETE.net should be used to make a full eMMC backup before doing anything.
Some DM250 hardware notes
The DM250's factory U-Boot detects Right Shift + Left Alt being pressed immediately after power-on and boots the recovery Linux kernel from its
recovery_kernel
partition instead of its normalkernel
partition. The recovery kernel boots the initramfs image at therecovery_boot
partition which mounts the SD card and executes any_sdboot.sh
script found at its root directory. - If you hold Shift + Alt too long at power-on, it will instead boot its graphical factory hardware test program. The recovery kernel and script do not show any output on the console while they boot and run. Hold down Right Shift + Left Alt + Power and count 3 seconds, then let go and it should boot the recovery kernel and
_sdboot.sh
from the SD card. - Once the new U-Boot image is written to the eMMC (even before going through the OpenBSD installer), the DM250 will no longer be able to boot the original Linux kernel or recovery. You'll need to boot something via EFI to write the backup U-Boot image to eMMC to get back to the factory software. This can be done with the OpenBSD installation SD card created here by dropping to a shell.
The DM250 will not fully power off with a USB-C cable connected to power (even with the factory Linux software). This means even if you
halt -p
and it powers itself off, it will immediately power back on. My U-Boot detects if the lid is closed when it first boots and if it's closed, it will halt the boot process so it doesn't boot into OpenBSD while it's closed on your desk trying to charge (though it will still be powered up to U-Boot). - A working battery is required to be able to provide enough power even with a USB-C cable connected. If the battery is completely drained, it may not be able to boot up far enough to get to U-Boot for it to be able to tell the charging chip to go into a higher charge mode. By default it does a trickle charge but because it will always try to power on as soon as it has power connected, it may quickly drain the power it just added to the battery trying to boot. In short, don't let the battery drain completely.
Making an OpenBSD installation SD card
These instructions assume you're running OpenBSD (any architecture).
You'll need an SD card of a few GB, which is assumed to be sd1
here.
Format an SD card with a GPT partition layout, making an EFI partition of at least 100MB and giving the rest to an OpenBSD partition.
# fdisk -ygb 204800 sd1 # echo -e "a\n\n\n\n\nw\nx" | disklabel -E sd1 # newfs /dev/rsd1a # newfs_msdos /dev/rsd1i # mount /dev/sd1i /mnt
U-Boot and OpenBSD will use that EFI partition as its firmware partition, but the original Pomera recovery software will see it as a normal MSDOS partition and run the
/_sdboot.sh
script contained on it. - Fetch the standard OpenBSD armv7 EFI bootloader to the SD card's EFI partition as
/efi/boot/BOOTARM.EFI
.# mkdir -p /mnt/efi/boot # cd /mnt/efi/boot # ftp https://cdn.openbsd.org/pub/OpenBSD/snapshots/armv7/{BOOTARM.EFI,SHA256.sig} # signify -C -x SHA256.sig BOOTARM.EFI
Fetch my
uboot.img
to the EFI partition as/uboot.img
. This U-Boot image has an embedded copy of the binary device-tree built from my Linux tree for the DM250 (JP).# cd /mnt # ftp https://jcs.org/dm250/uboot.img
Fetch this installation script to the EFI partition as
/_sdboot.sh
. This will get executed by the factory recovery partition's boot system once the DM250 is booted into recovery mode. The script mounts the EFI partition of the SD card, backs up all of the firmware files from the eMMC to the SD card, makes a backup of the current eMMC U-Boot partition to the SD card, and then writes the new U-Boot image from the SD card to the eMMC.# ftp https://jcs.org/dm250/_sdboot.sh
Switch to the OpenBSD partition of the SD card and fetch the latest OpenBSD armv7 snapshot disk images to it.
# cd / # umount /mnt # mount /dev/sd1a /mnt # cd /mnt # ftp https://cdn.openbsd.org/pub/OpenBSD/snapshots/armv7/{SHA256.sig,INSTALL.armv7,base79.tgz,comp79.tgz,game79.tgz,man79.tgz,xbase79.tgz,xfont79.tgz,xserv79.tgz,xshare79.tgz} # signify -C -x SHA256.sig *.tgz
Fetch the current
bwfm
firmware so you can have working Wi-Fi after installation.# ftp http://firmware.openbsd.org/firmware/snapshots/{SHA256.sig,bwfm-firmware-20200316.1.3p5.tgz} # signify -C -x SHA256.sig bwfm-firmware-*
Fetch my
bsd.rd
ramdisk image andbsd
kernel.# ftp https://jcs.org/dm250/bsd{,.rd}
Your SD card is now ready to go. Unmount it.
# cd / # umount /mnt
Installing OpenBSD
Insert the prepped SD card into the DM250. If it's plugged into power, unplug it. If it's powered up, power it down.
Hold down the Right Shift + Left Alt + Power buttons.
As soon as the Pomera logo displays, wait about two seconds and let go.
The Pomera logo will clear and the recovery kernel should now boot.
It will execute the _sdboot.sh
script on the SD card which will make a backup of the existing U-Boot partition to the SD card and write the new one. Nothing will be shown on the screen while it's working but it should only take about 30 seconds. Once it's done, it will reboot the device.
At this point it will boot the new U-Boot with EFI support and video and keyboard drivers for the DM250. If it detected the eMMC and SD card properly, it will boot the OpenBSD EFI bootloader.
No EFI variables loaded
Loading Boot0000 'mmc 0' failed
Booting: Label: mmc 1 Device path: /VenHw(...)/SD(1)/SD(0)
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.23
boot>
Enter b bsd.rd
to boot the installer.
boot> b bsd.rd
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:bsd.rd: ...
When prompted for the root disk, enter ?
to see which is which.
The eMMC should be sd1
showing 7.3G.
If installing to the eMMC, use the whole
disk option to let it create a new MBR with an EFI partition offset by 16MB so it does not overwrite the Rockchip ID block or U-Boot that live at the beginning of the disk.
You can accept the auto-allocated partition layout or just make one big root
and a swap partition.
When prompted for the location of the sets, specify disk
and then respond no
that it's not mounted, and enter sd0
(the SD card), then partition a
.
The pathname to the sets will be just /
.
Continue installing, ignoring the error from signify.
The installer should automatically pick up the bwfm
firmware and install it.
At the end it will try to re-link the kernel which is using the upstream kernel
object files, so it's important you copy the custom kernel back over /bsd
.
Exit to (S)hell, (H)alt or (R)eboot? [reboot] s
To boot the new system, enter 'reboot' at the command prompt.
# mount /dev/sd0a /mnt2
# cp /mnt2/bsd /mnt/bsd
You'll also need to disable reorder_kernel
which will run at each boot so it doesn't revert the kernel back to
Source: Hacker News















