# NanoBSD pcengines



## Ofloo (Feb 1, 2018)

Compiled nanobsd and got this error at boot:


```
Trying to mount root from ufs:/dev/ad0s1a [ro]...
Root mount waiting for: usbus1 usbus0
uhub0: 4 ports with 4 removable, self powered
Root mount waiting for: usbus1
uhub1: 4 ports with 4 removable, self powered
mountroot: waiting for device /dev/ad0s1a...
Mounting from ufs:/dev/ad0s1a failed with error 19.

Loader variables:
  vfs.root.mountfrom=ufs:/dev/ad0s1a
  vfs.root.mountfrom.options=ro

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:tank
        cd9660:/dev/cd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot>
```

Listed the available drives, ..?


```
mountroot> ?

List of GEOM managed disk devices:
  ufsid/5a724a1d59b386c0 diskid/DISK-20110805%20CF13120Es1a ufsid/5a724a28e934bfef ada0s1a diskid/DISK-20110805%20CF13120Es3 diskid/DISK-20110805%20CF13120Es2 diskid/DISK-20110805%20CF13120Es1 ada0s3 ada0s2 ada0s1 diskid/DISK-20110805%20CF13120E ada0

mountroot>
```

Noticed that the disk names do not match, ..

ofcourse , ..  after typing ufs:/dev/ada0s1


```
mountroot> ufs:/dev/ada0s1a
Trying to mount root from ufs:/dev/ada0s1a []...
mount: /dev/ad0s3: No such file or directory
mount -o ro /dev/ad0s3 /conf/default/etc failed: dropping into /bin/sh
# random: unblocking device.
```

Since this is a configuration file specific to this hardware. Maybe, it should be changed to the actual device name. So when someone wants to play with it, they're provided with an actual working configuration file ?


```
Index: alix_dsk.conf
===================================================================
--- alix_dsk.conf       (revision 328623)
+++ alix_dsk.conf       (working copy)
@@ -24,6 +24,6 @@
 NANO_INIT_IMG2="0"
 #NANO_BOOT0CFG="-o packet,noupdate -s 1 -m 3"
 NANO_BOOT0CFG="-o packet,update,nosetdrv -s 1 -m 3"
-NANO_DRIVE=ad0
+NANO_DRIVE=ada0
 . common.conf
```


----------



## Phishfry (Feb 1, 2018)

What you seeing is that the /nanobsd/pcengines/ files are all real old.
In the past ad0 was the correct name for a hard drive. It has changed to ada0 for a while now.

My procedure is to make a new directory under nanobsd and copy /nanobsd/embedded/common into my new directory.
Then I use /nanobsd/embedded/i386.cfg as a template for my config.

For example here is my Checkpoint U-5 board config:
/usr/src/tools/tools/nanobsd/checkpoint/checkpoint.cfg

```
NANO_ARCH=i386
NANO_KERNEL=GENERIC
NANO_DRIVE=ada0
NANO_NAME=checkpoint
NANO_BOOTLOADER="/boot/boot0"
NANO_BOOT_MBR="/boot/boot0"
NANO_BOOT0CFG="-o packet -s 2 ${NANO_DRIVE}"
customize_cmd cust_pkgng
NANO_PACKAGE_LIST="pkg dnsmasq"

. common        # Pull in common definitions, keep last
```
I also modify /nanobsd/checkpoint/common

As you can see from my sample I am also including packages and have a /nanobsd/pkg/ directory for those.

Warner has added the embedded directory as an extension of NanoBSD.
You should read /usr/src/tools/tools/nanobsd/embedded/README for details.

If your target is a 64-bit CPU you can use this instead.
NANO_ARCH=amd64


----------



## Ofloo (Feb 1, 2018)

Thank you for pointing that out, .. it was in fact my next thing on my list to see, on how to do this.


----------



## Phishfry (Feb 1, 2018)

Here is a bug and patch fix you will need.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219405


----------



## Ofloo (Feb 2, 2018)

```
00:02:15 ## customize "cust_etc_cfg"
00:02:15 ### log: /usr/src/../ofl/obj/_.cust.cust_etc_cfg
00:02:15 ## configure nanobsd setup
00:02:15 ### log: /usr/src/../ofl/obj/_.dl
00:02:16 ## run late customize scripts
../nanobsd.sh: create_diskimage: not found
root@luci:/usr/src/tools/tools/nanobsd/pcengines #
```

Are there additional files I need to update?


----------



## Phishfry (Feb 2, 2018)

You might need this patch too on FreeBSD 11:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216829


----------

