# use of undeclared identifier 'SYS_freebsd11_mknod'



## ndoody (Jan 24, 2022)

I'm trying to install ImageMagic6 from the ports, running FreeBSD STABLE 11.4.  I am using portmaster to install.

When it tries to install one of the rust dependencies, I get the following error :-

```
===>  Configuring for rust-1.58.0
===>   FreeBSD 10 autotools fix applied to /usr/ports/lang/rust/work/rustc-1.58.0-src/vendor/libssh2-sys/libssh2/config.rpath
<stdin>:8:17: error: use of undeclared identifier 'SYS_freebsd11_mknod'
        return syscall(SYS_freebsd11_mknod, "", 0, 0) < 0 && errno == ENOSYS;
                       ^
```
So very little around this error, I've fixed a few of these type of things recently and they've been to using the wrong libraries mainly due to poor upgrade practices...ports conflicting with the user land installs / etc.

It's an i386 build, just because it's been upgraded from as far back as around Freebsd 4 I think...maybe this particular build started it's life as Freebsd 6.  The more I learn, the more I realise I had missed a lot of migration steps...ones like rebuilding/reinstalling all ports which I'm a bit worried to do now as it always breaks so many things where I used to compile some stuff in ports and some stuff manually.

I think most kinks are worked out, just this particular one - I dunno what to do.


----------



## covacat (Jan 24, 2022)

11.4 is no longer supported and rust requires Freebsd11 compatibility in newer kernels
you have to upgrade to 12.3 or 13.0
or build imagemagick without the dependency that brings in rust


----------



## SirDice (Jan 24, 2022)

Correct, the entire 11 major branch (including 11-STABLE) is EoL since September 2021.


----------



## ndoody (Jan 24, 2022)

covacat said:


> 11.4 is no longer supported and rust requires Freebsd11 compatibility in newer kernels
> you have to upgrade to 12.3 or 13.0
> or build imagemagick without the dependency that brings in rust


Oh okay, thanks, is there an easy way to tell the imagemagick port to build without rust?

I'll look at upgrading freebsd again to the latest version, I just wince about what will stop working next each time I go through an upgrade


----------



## SirDice (Jan 24, 2022)

If you use ZFS I can highly recommend using a boot environment for the upgrade. Then you can easily switch back in case the upgrade goes sideways.

But unless you use some exotic, home-grown, application the upgrade should be fairly straightforward. Remember, all versions use the same ports tree, so you still have the exact same third party software, regardless of the FreeBSD version.


----------



## covacat (Jan 24, 2022)

i don't see any direct dependency wanting rust but it may be a level 2 or deeper
you can scroll your build screen and see why

anyway, if upgrade is an option then upgrade
it's a pain in the neck to keep up with packages on an unsupported system
sooner or later make fill fail by being unable to parse /usr/port/Mk/something.mk and so on


----------



## ndoody (Jan 25, 2022)

SirDice said:


> If you use ZFS I can highly recommend using a boot environment for the upgrade. Then you can easily switch back in case the upgrade goes sideways.
> 
> But unless you use some exotic, home-grown, application the upgrade should be fairly straightforward. Remember, all versions use the same ports tree, so you still have the exact same third party software, regardless of the FreeBSD version.



I don't think I use ZFS, it's originally an old build that's come along way.

So, I did try to upgrade...ran the freebsd-update for version 12.3.  I'm getting kernel panics constantly after the first reboot following freebsd-update install.

I have booted into the old kernel using kernel.old, it's up and running.  What do I do when an install goes completely sideways like this, what's the next steps...presumably taking a copy of kernel.old so I've always got it to go back on (restarting the install would cause this to be overwritten with the 12.3 right?).  I was reading some articles, and it said to check ERATA for known stuff, but there doesn't seem to be any for 12.3...

IT's up and running ont he old kernel at least, receiving email - I need to research and get a solid action plan before moving forward.  Can't afford to have it unrecoverable, it's my home email server.


----------



## ndoody (Jan 25, 2022)

Trying to get what I can of the kernel crash, it has similar info to this bug :-






						261338 – [PATCH] kernel panic "bad pte" under heavy CPU load on 12.2 and 12.3 (i386)
					






					bugs.freebsd.org
				




Except, this is happening at each reboot and not just under load...it's really hard to get any detailed info, as the screen just moves too quickly on the console I can't capture much.  What I am seeing is attached in the screenshot.  This is an i386 build, running in hyper-V...it really should be updated to amd64, but that's another headache.


----------



## ndoody (Jan 26, 2022)

Should I create a new thread for this latest problem, as it's somewhat diverged from the initial topic...where should I post it?


----------



## SirDice (Jan 26, 2022)

ndoody said:


> So, I did try to upgrade...ran the freebsd-update for version 12.3. I'm getting kernel panics constantly after the first reboot following freebsd-update install.





ndoody said:


> Trying to get what I can of the kernel crash


The crash is likely due to having external kernel modules that were built for 11.x loading on a 12.x kernel. 

You only did a `freebsd-update install` once? Then rebooted and it immediately crashed on boot? You then managed to boot kernel.old? That's fine, we'll continue from there. Go through /boot/loader.conf and /etc/rc.conf, disable _everything_ you don't strictly need to boot the machine. Disable any services you might be starting. This is just temporary, you can enable all that again when you finished the upgrade. 

With as much disabled as possible try booting the new kernel again. This should not crash any more. Then run the _second_ `freebsd-update install`. That might take a while, the first install only upgrades the kernel, the second install will upgrade the rest of the base OS. After that finished, run `pkg upgrade`, after a major version upgrade you _must_ reinstall everything. That should all finish without problems. Then run the _third_, and final, `freebsd-update install`. That last install run will remove the old libraries and other files that need to be cleaned up. Reboot, the system should boot fine with 12.3. Now you can enable all the services and modules again you disabled earlier.


----------



## ndoody (Jan 26, 2022)

SirDice said:


> The crash is likely due to having external kernel modules that were built for 11.x loading on a 12.x kernel.
> 
> You only did a `freebsd-update install` once? Then rebooted and it immediately crashed on boot? You then managed to boot kernel.old? That's fine, we'll continue from there. Go through /boot/loader.conf and /etc/rc.conf, disable _everything_ you don't strictly need to boot the machine. Disable any services you might be starting. This is just temporary, you can enable all that again when you finished the upgrade.
> 
> With as much disabled as possible try booting the new kernel again. This should not crash any more. Then run the _second_ `freebsd-update install`. That might take a while, the first install only upgrades the kernel, the second install will upgrade the rest of the base OS. After that finished, run `pkg upgrade`, after a major version upgrade you _must_ reinstall everything. That should all finish without problems. Then run the _third_, and final, `freebsd-update install`. That last install run will remove the old libraries and other files that need to be cleaned up. Reboot, the system should boot fine with 12.3. Now you can enable all the services and modules again you disabled earlier.


Okay, thanks...I've tried all this.

bootloader.conf had only one, cpu core temp.  Set that to NO, I'll never need that - I think it's something I used to watch a long time ago when this was a hardware box and I used to run so MRTG graphing to monitor the system temperature.

Checked through /etc/rc.conf and I REM'ed everything out that was xxx="YES".  Nothing to note, usual postfix/clamav software...moduly I guess linux_enable and firewall_enable. I ony left basic ssh and setting up the network card features enabled in that file.

Still exactly the same thing, the kernel panic happens really quickly whilst it's loading the hardware stuff - it doesn't get chance to even start my services from watching the screen.  I see the last thing is "vmbus_res0: <Hyper-V Vmbus Resource> irq 5,7 on acpi0" that I can capture before the crash.  Looking at dmesg, around that time these things start :-



> vmbus_res0: <Hyper-V Vmbus Resource> irq 5,7 on acpi0
> pmtimer0 on isa0
> orm0: <ISA Option ROM> at iomem 0xc0000-0xcbfff pnpid ORM0000 on isa0
> vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
> ...



Pretty sure we don't get past this before the system crashes...it's jsut too quick to see.

What should I do next?  Did you see the link I posted, some of the dump info fits exactly with it "0x10438ee" and there is only one google hit for this...any correlation?


----------



## ndoody (Jan 26, 2022)

THought I might give you the whole dmesg output after all the modules were disabled, so you can see what's remaining :-



> Copyright (c) 1992-2020 The FreeBSD Project.
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
> The Regents of the University of California. All rights reserved.
> FreeBSD is a registered trademark of The FreeBSD Foundation.
> ...


----------



## ndoody (Jan 26, 2022)

And this is everything that is loaded after, by running "top"...you can see nothing is running and nothing special is loaded after I've trimmed it all out. I don't recall having any special options, and I am just running out of the box GENERIC kernel before running freebsd-install already.  I had only ever customised it years ago to enable SMP, and that has long been default.


----------



## SirDice (Jan 26, 2022)

i386 with 128GB memory? Really? You know i386 can only address 4GB, right? Yes, with PAE it can do more, but you really don't want to tread that path. On Hyper-V? And only one core? That's the oddest looking configuration I've seen in a while. I would recommend backing up the data from it, make a note of the configuration, and rebuild it using a 64 bit FreeBSD.


----------



## ndoody (Jan 26, 2022)

SirDice said:


> i386 with 128GB memory? Really? You know i386 can only address 4GB, right? Yes, with PAE it can do more, but you really don't want to tread that path. On Hyper-V? And only one core? That's the oddest looking configuration I've seen in a while. I would recommend backing up the data from it, make a note of the configuration, and rebuild it using a 64 bit FreeBSD.



Ahh, it had 12GB assigned...not 128GB?  The physical server has only 64GB.  And yes, when I migrated the machine I hadn't remembered that it was i386 and that memory assignment is just what I'd put when I first configured it (8 cores/12GB ram).

It had 8 cores, but I had trimmed it back down to 1 core for testing...because the article I had found regarding the error suggested about multiple cores. 

I had actually already set the memory back to 4096 to match the limit, just to eliminate that.  It didn't help, but it can stay at 4GB as it's more than enough for the system to run happily without using much, if any, of the swap.


So any more ideas on how to get the current i386 build working?


----------



## covacat (Jan 27, 2022)

just go the amd64 route
i386 is on it's way out anyway 2nd tier, etc, etc


----------



## ndoody (Jan 27, 2022)

covacat said:


> just go the amd64 route
> i386 is on it's way out anyway 2nd tier, etc, etc


Yeah, I know...but it really suffices in what I need for now - and I only want to keep it running for a few months whilst I work out the migration path I want to take to a new email solution.

I really didn't want to spend too much effort in recreating this particular system, and also with the least amount of downtime because my own email sits on there.

However, I have looked at the following guide...anyone know the success rate of this :-





__





						amd64/i386Migration - FreeBSD Wiki
					





					wiki.freebsd.org


----------



## SirDice (Jan 28, 2022)

Rebuilding a new VM with a 64 bit OS is easier, quicker and less error-prone.


----------

