# boot problem after update to 13.0



## tsk (Jul 30, 2021)

Hi,

I have a problem with booting after I updated from 12.2 to 13.0:

```
Loading /boot/defaults/loader.conf
console-iterate not found
Error while including /boot/beastie.4th, in the line:
      ['] draw-beastie console-iterate

can't load kernel
```
I can then manually do:

```
set currdev=...
boot
```
which boots the machine fine.

The problem seems to be that the function console-iterate is not available when running the loader.conf script.
Is there some include of the support.4th file missing in beastie.4th or so? Sorry don't now anything about forth...

And why I'm the only one that is encountering that?

Any help?

tsk


----------



## SirDice (Jul 30, 2021)

FreeBSD 13.0 uses the new LUA loader(8) (12.2 also used the LUA loader(8)). Why would it give an error on the old Forth code that's not used anymore?

How is the system booted? UEFI or CSM? What's in /boot/loader.conf? Also double check /boot/defaults/loader.conf for any merge issues.


----------



## tsk (Jul 30, 2021)

SirDice said:


> FreeBSD 13.0 uses the new LUA loader(8) (12.2 also used the LUA loader(8)). Why would it give an error on the old Forth code that's not used anymore?
> 
> How is the system booted? UEFI or CSM? What's in /boot/loader.conf? Also double check /boot/defaults/loader.conf for any merge issues.


I don't have a /efi, so I assume it is the compatibility mode. It is a Gigabyte Dualbios(?) motherboard.
/boot/loader.conf is:

```
#currdev="disk1p2"
accf_http_load="YES"
accf_data_load="YES"
#acpi_data_load="YES"
ipfw_load="YES"
ipdivert_load="YES"
kern.ipc.semmni=256
kern.ipc.semmns=512
kern.ipc.semmnu=256

# for vt (previously newcons)
hw.vga.textmode=1
kern.vty=vt
kern.vt.fb.default_mode="1024x768"
```

/boot/defaults/loader.conf is identical to /usr/src/stand/defaults/loader.conf

Why it apparently uses the forth code, I don't know...


----------



## SirDice (Jul 30, 2021)

tsk said:


> I don't have a /efi, so I assume it is the compatibility mode.


Don't assume. You can tell how the system was booted by looking at the `machdep.bootmethod` sysctl:

```
root@molly:~ # sysctl machdep.bootmethod
machdep.bootmethod: UEFI
```

Based on the disk1p2 this system is UFS? 

Not related to the issue but you can remove these:

```
accf_http_load="YES"
accf_data_load="YES"
#acpi_data_load="YES"
```
And add `apache24_http_accept_enable="YES"` to /etc/rc.conf, that will load them automatically. 


```
ipfw_load="YES" 
ipdivert_load="YES"
```
These don't need to be loaded either, they're automatically loaded when you enable the firewall in rc.conf. 


```
kern.vty=vt
```
Doesn't need to be set either, it's the default and has been for a while.


----------



## mer (Jul 30, 2021)

Was the system installed as a 12.x or was it installed with something earlier?
Installed as something that used the forth loader by default and then upgraded through 12 to 13 may be a 
way to have this.


----------



## SirDice (Jul 30, 2021)

Do you still have a /boot/support.4th? That `console-iterate` function is defined in there.


----------



## tsk (Jul 30, 2021)

SirDice said:


> Don't assume. You can tell how the system was booted by looking at the `machdep.bootmethod` sysctl:
> 
> ```
> root@molly:~ # sysctl machdep.bootmethod
> ...



Ups:
sysctl.boothmethod: BIOS



SirDice said:


> Based on the disk1p2 this system is UFS?


Yes. Anthing better around?


SirDice said:


> Not related to the issue but you can remove these:
> 
> ```
> accf_http_load="YES"
> ...


Ok


SirDice said:


> ```
> ipfw_load="YES"
> ipdivert_load="YES"
> ```
> ...


Ok

You see, this installation is pretty old.
I'm using ***BSD since Terry Jolitz came out with bsd386 release 0.0. I think I still have (private) files around from then...


----------



## tsk (Jul 30, 2021)

SirDice said:


> Do you still have a /boot/support.4th? That `console-iterate` function is defined in there.


Yes, that file is still there. According to the date it is still installed by make installworld on the last update...


----------



## eternal_noob (Jul 30, 2021)

tsk said:


> You see, this installation is pretty old.


Depending on how old it is i suggest to backup all your data and do a complete fresh install rather than an update.


----------



## tsk (Jul 30, 2021)

eternal_noob said:


> Depending on how old it is i suggest to backup all your data and do a complete fresh install rather than an update.


Really? Doesn't make installworld and mergemaster a pretty good job in housekeeping?
I think, there is only a problem in booting...


----------



## eternal_noob (Jul 30, 2021)

tsk said:


> Really? Doesn't make installworld and mergemaster a pretty good job in housekeeping?


Yeah, usually updates work pretty smooth. But like i said, it depends on the version you installed.



tsk said:


> I think, there is only a problem in booting...


That's the first problem you encountered. There may be more...

I never updated multiple versions in one go.I even did a fresh install when going from 12.1 to 13.0.


----------



## covacat (Jul 30, 2021)

/boot/loader is  hard linked to either loader_4th or loader_lua
i assume yours is the 4th one
check /boot/*.4th and /boot/*.rc against sources or just switch to lua


----------



## SirDice (Jul 30, 2021)

covacat said:


> /boot/loader is hard linked to either loader_4th or loader_lua
> i assume yours is the 4th one


Yeah, that might be the case here. tsk check which loader you're using:


```
root@molly:/boot # ls -ali /boot/loader /boot/loader_4th /boot/loader_lua
546652 -r-xr-xr-x  3 root  wheel  491520 Jul 10 14:53 /boot/loader
546651 -r-xr-xr-x  1 root  wheel  430080 Jul 10 14:53 /boot/loader_4th
546652 -r-xr-xr-x  3 root  wheel  491520 Jul 10 14:53 /boot/loader_lua
```
As you can see by the inode numbers I'm using the LUA loader.


----------



## tsk (Jul 30, 2021)

SirDice said:


> Yeah, that might be the case here. tsk check which loader you're using:
> 
> 
> ```
> ...


/boot/loader is hard linked to loader_lua here as well. So why am I getting error messages from the forth loader?


----------



## SirDice (Jul 30, 2021)

tsk said:


> So why am I getting error messages from the forth loader?


That's what I'm wondering too. 

Maybe a bit of long shot but have you tried updating the bootloader? Check for the correct partition number and disk, make sure you're referencing the freebsd-boot partition:
`gpart bootcode -p /boot/gptboot -i 1 ada0`


----------

