nanobsd error while performing installworld: "No such file or directory"

Worked fine with FreeBSD 13 but not with FreeBSD 13.1

Exits with the following error:

Code:
--- _testsFILESINS_Kyuafile ---
--- realinstall_subdir_usr.bin/lex ---
install: link /usr/obj/nanobsd.nsginstaller/_.w/usr/lib/libln_p.a -> /usr/obj/nanobsd.nsginstaller/_.w/usr/lib/libl_p.a: No such file or directory
*** [_installlinks] Error code 71

make[6]: stopped in /usr/src/usr.bin/lex/lib
1 error

make[6]: stopped in /usr/src/usr.bin/lex/lib

make[3]: stopped in /usr/src
--- realinstall_subdir_usr.sbin ---

make[6]: stopped in /usr/src/usr.sbin/ntp/doc

make[5]: stopped in /usr/src/usr.sbin/ntp

make[4]: stopped in /usr/src/usr.sbin

make[3]: stopped in /usr/src

make[2]: stopped in /usr/src
*** [installworld] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src

make: stopped in /usr/src
 
Well first thing I would do is build WITHOUT_LEX
Do you use lex(1)?
That would be a quick and easy check to see if that is the ultimate problem.
 
The Makefile does this which seems to be the problem:

usr/src/usr.bin/lex/lib/MakefileL.17
LINKS+= ${LIBDIR}/libln_p.a ${LIBDIR}/libl_p.a
 
uses the re2c pattern, there are many others available, build with re2c
 
One more path to check from the Makefile:
/usr/src/contrib/flex/
Does this exist on FreeBSD 13.1?
Yes this exists.
Code:
ls -lh /usr/src/contrib/flex
total 191
-rw-r--r--  1 root  wheel   1.8K May 12 05:53 COPYING
-rw-r--r--  1 root  wheel   332K May 12 05:53 ChangeLog
-rw-r--r--  1 root  wheel    23K May 12 05:53 NEWS
-rw-r--r--  1 root  wheel    45K May 12 05:53 ONEWS
-rw-r--r--  1 root  wheel   4.0K May 12 05:53 README.md
drwxr-xr-x  2 root  wheel    34B May 12 05:53 src

As does

Code:
ls -lh /usr/src/usr.bin/lex
total 225
-rw-r--r--  1 root  wheel   1.6K May 12 05:54 Makefile
-rw-r--r--  1 root  wheel   279B May 12 05:54 Makefile.depend
-rw-r--r--  1 root  wheel   7.5K May 12 05:54 config.h
-rw-r--r--  1 root  wheel    49K May 12 05:54 initparse.c
-rw-r--r--  1 root  wheel   1.0K May 12 05:54 initparse.h
-rw-r--r--  1 root  wheel   164K May 12 05:54 initscan.c
-rw-r--r--  1 root  wheel   121K May 12 05:54 initskel.c
-rw-r--r--  1 root  wheel   104K May 12 05:54 lex.1
drwxr-xr-x  2 root  wheel     4B May 12 05:54 lib
-rw-r--r--  1 root  wheel   131B May 12 05:54 version.awk
 
Interestingly I have just run
Code:
./nanobsd.sh -c test.nano
Where test nano contains the following (So that the output disk image is large enough)
Code:
UsbDevice generic 12000
echo "NANO_MEDIASIZE: ${NANO_MEDIASIZE}"
And it completed successfully.
So it must be something in my customization file that makes it fail.
 
Are you using any WITHOUT='s in your config ?? You may need to add them later in the build process.

I copy my /etc/make.conf in to position after building world and kernel.
 
My nano config file has the following CONF* in. Is that what you mean?

Code:
CONF_BUILD='
NO_NETGRAPH=YES
NO_PAM=YES
'

CONF_INSTALL='
NO_ACPI=YES
NO_BLUETOOTH=YES
NO_CVS=YES
NO_FORTRAN=YES
NO_HTML=YES
NO_LPR=YES
MK_MAN=no
NO_SENDMAIL=YES
NO_SHAREDOCS=YES
NO_EXAMPLES=YES
MK_INSTALLLIB=no
NO_CALENDAR=YES
NO_MISC=YES
NO_SHARE=YES
'

CONF_WORLD='
NO_BIND=YES
NO_KERBEROS=YES
NO_GAMES=YES
NO_RESCUE=YES
NO_LOCALES=YES
NO_SYSCONS=YES
NO_INFO=YES
'
 
My nano config file has the following CONF* in. Is that what you mean?
Yes these control what happens in certain stages of your build.
Pull the compiling tools out of the build too soon and guess what happens.

CONF_BUILD='
CONF_INSTALL='
CONF_WORLD='
What worries me is I see you have ACPI WITHOUT. (NO_ACPI=YES)
You better know your hardware before messing there. Most modern hardware won't even boot without ACPI.
ACPI has several sub-branches like ACPI thermal or ACPI video.
You might want to disable them instead of all of ACPI.


Which ones are profiling libraries?
I believe he is talking about lex, flex and re2c.
None of that should be needed for an embedded build.
 
Yes these control what happens in certain stages of your build.
Pull the compiling tools out of the build too soon and guess what happens.




What worries me is I see you have ACPI WITHOUT. (NO_ACPI=YES)
You better know your hardware before messing there. Most modern hardware won't even boot without ACPI.
ACPI has several sub-branches like ACPI thermal or ACPI video.
You might want to disable them instead of all of ACPI.



I believe he is talking about lex, flex and re2c.
None of that should be needed for an embedded build.
This is what get printed out when I execute nanobsd.sh
Code:
00:00:00 ### Exporting NanoBSD variables
00:00:00 ### Setting variable: MAKEOBJDIRPREFIX="/usr/obj/nanobsd.myinstaller"
00:00:00 ### Setting variable: NANO_ARCH="amd64"
00:00:00 ### Setting variable: NANO_CODESIZE="0"
00:00:00 ### Setting variable: NANO_CONFSIZE="2048"
00:00:00 ### Setting variable: NANO_CUSTOMIZE=" cust_install_files cust_allow_ssh_root cust_nobeastie cust_var_size install_packages install_installer install_installer_instance"
00:00:00 ### Setting variable: NANO_DATASIZE="0"
00:00:00 ### Setting variable: NANO_DRIVE="ufs/nsginstaller"
00:00:00 ### Setting variable: NANO_HEADS="255"
00:00:00 ### Setting variable: NANO_IMAGES="1"
00:00:00 ### Setting variable: NANO_IMGNAME="_.disk.full"
00:00:00 ### Setting variable: NANO_IMG1NAME="_.disk.image"
00:00:00 ### Setting variable: NANO_MAKE="make -j 16"
00:00:00 ### Setting variable: NANO_MAKE_CONF_BUILD="/usr/obj/nanobsd.myinstaller/make.conf.build"
00:00:00 ### Setting variable: NANO_MAKE_CONF_INSTALL="/usr/obj/nanobsd.myinstaller/make.conf.install"
00:00:00 ### Setting variable: NANO_MEDIASIZE="23437500"
00:00:00 ### Setting variable: NANO_NAME="myinstaller"
00:00:00 ### Setting variable: NANO_NCPU="16"
00:00:00 ### Setting variable: NANO_NEWFS="-b 4096 -f 512 -i 8192 -U"
00:00:00 ### Setting variable: NANO_OBJ="/usr/obj/nanobsd.myinstaller"
00:00:00 ### Setting variable: NANO_PMAKE="make -j 16"
00:00:00 ### Setting variable: NANO_SECTS="63"
00:00:00 ### Setting variable: NANO_SRC="/usr/src"
00:00:00 ### Setting variable: NANO_TOOLS="/usr/src/tools/tools/nanobsd"
00:00:00 ### Setting variable: NANO_WORLDDIR="/usr/obj/nanobsd.myinstaller/_.w"
00:00:00 ### Setting variable: NANO_BOOT0CFG="-o packet -s 1 -m 3"
00:00:00 ### Setting variable: NANO_BOOTLOADER="boot/boot0"
00:00:00 ### Setting variable: NANO_LABEL="myinstaller"
00:00:00 ### Setting variable: NANO_MODULES="zfs opensolaris"
00:00:00 ### Setting variable: NANO_NOPRIV_BUILD=""
00:00:00 ### Setting variable: NANO_METALOG=""
00:00:00 ### Setting variable: NANO_LOG="/usr/obj/nanobsd.myinstaller"
00:00:00 ### Setting variable: SRCCONF="/dev/null"
00:00:00 ### Setting variable: SRC_ENV_CONF="/dev/null"

I just tried removing all the CONF_* configurations and it completed with no errors. I'll work through and see if I can narrow down the one causing issues.
 
Fails during the 'build diskimage' step now...

Code:
cat /usr/obj/nanobsd.myinstaller/_.di
Creating md backing file...
0+0 records in
0+0 records out
0 bytes transferred in 0.000045 secs (0 bytes/sec)
md0 created
md0s1 added
md0s2 added
active set on md0s1
=>      63  23437437  md0  MBR  (11G)
        63  23406642    1  freebsd  [active]  (11G)
  23406705     16065    2  freebsd  (7.8M)
  23422770     14730       - free -  (7.2M)

bootcode written to md0
Writing code image...
182864+1 records in
182864+1 records out
11984200704 bytes transferred in 267.756475 secs (44757837 bytes/sec)
Creating /dev/md0s3 (mounting on /usr/obj/nanobsd.myinstaller/_.mnt)
newfs -b 4096 -f 512 -i 8192 -U -Lmyinstallers3 /dev/md0s3
newfs: /dev/md0s3: could not find special device
Running exit trap code
Filesystem         1K-blocks     Used    Avail Capacity iused    ifree %iused  Mounted on
zroot/ROOT/default  60351120 30249648 30101472    50%  322672 60202944    1%   /
umount: /usr/obj/nanobsd.myinstaller/_.mnt: not a file system root directory
 
The nanobsd.sh and legacy.sh scripts changed between FreeBSD 13 and 13.1. I've copied them from 13 into my environment and now nano.sh completes successfully.
Maybe there is a bug in those scripts somewhere. I'll install a fresh 13.1 and see it the problem persists.
 
I'm having the same error since I've updated to FreeBSD 13.1:
Code:
newfs -b 4096 -f 512 -i 8192 -U -Lnanobsds3 /dev/md0s3
newfs: /dev/md0s3: could not find special device
Running exit trap code

My nanobsd script was working fine with FreeBSD 13.0, 12.x, 11.x,… (and probably even with 10.x).

I haven't found how to solve it.
 
Back
Top