# Updating On an RPI 3



## Beastwick (Sep 22, 2019)

Hi everyone!

I know that the Raspberry Pi is not a tier 1 system, so I have been struggling with ways to update my kernel without having to do it on the Pi itself, for I fear that would take way too long than I have patience for.

I am about to move on to trying out Crochet, but I would like to know where I am going wrong with what I tried. Unfortunately I do not have any build output to troubleshoot.

Basically I am cross compiling inside an amd64 virtual machine. After the object files are created, I am SCPing the object files over to where they should reside on my Pi. I made sure that /usr/src are identical. Then, with all this done, I should theoretically be able to do a make installkernel right? This procedure did fail for me the first time I tried it, but I am willing to try it again if this sounds like a solid procedure. The second to last thing I'd like to try is using distcc for cross compiling, but this seems rather difficult. 

I am researching Crochet right now and I guess as long as I can have the tool install packages, which it looks like it can, and transfer over configuration files, this may be the route I am going to take.

Thanks!


----------



## Phishfry (Sep 22, 2019)

Beastwick said:


> I am cross compiling inside an amd64 virtual machine


Did you mean aarch64 QEMU VM?


			arm64/QEMU - FreeBSD Wiki


----------



## Beastwick (Sep 22, 2019)

Phishfry said:


> Did you mean aarch64 QEMU VM?
> 
> 
> arm64/QEMU - FreeBSD Wiki



I have not tried doing this. What I have been doing is a make buildworld and buildkernel with TARGET=arm64 on an amd64 box. How is the performance in a straight up QEMU virtual machine? Can I pass multiple cores to it?


----------



## Phishfry (Sep 22, 2019)

Sorry I thought that was a typo.
This thread was my crosscompile on amd64 for the BBB.








						Cross-compiling Beaglebone on amd64
					

Well I got tired of using crochet as a crutch and I figured out how to cross compile for Beaglebone. At first I cheated and wrote to the microSD Card, but I buckled down and figured out how to manipulate a memory disk.   [Copy Source to Build Dir] mkdir /BBB cp -vipr /usr/src /BBB/src mkdir...




					forums.freebsd.org
				



You should be able to run `make buildworld` and `make buildkernel` on amd64 and then copy over to Arm then run `make installworld` and `make installkernel`. For updating you need to run `mergemaster` some point in this process.
I beleive in-between `make installworld` and `make installkernel`.








						Chapter 25. Updating and Upgrading FreeBSD
					

Information about how to keep a FreeBSD system up-to-date with freebsd-update or Git, how to rebuild and reinstall the entire base system, etc




					www.freebsd.org
				



Also section 23.5.6.2 from the above -You also have to delete the old libraries on updates.


----------



## Beastwick (Sep 24, 2019)

So I am trying to go the Crochet route, can anyone help me figure out how to properly format the pkg repo URL?


```
Crochet config file:
option PackageInit http://pkg.freebsd.org/FreeBSD:12:aarch64/quarterly
```


```
updating tmp repository catalogue...
pkg: http://pkg.freebsd.org/FreeBSD:12:aarch64/quarterly/meta.txz: No address record
repository tmp has no meta file, using default settings
pkg: http://pkg.freebsd.org/FreeBSD:12:aarch64/quarterly/packagesite.txz: No address record
Unable to update repository tmp
Error updating repositories!
```

I am trying to use releng 12.1 src, I don't know if that affects the repo I should be trying to use.

edit; I think I found the solution to this problem. I had to either put in a resolv.conf in my overlay or enable option Resolv.


----------



## Beastwick (Sep 29, 2019)

Hi everyone, an update with help needed!

I am still trying to compile the kernel, this time using the device itself. I managed to boot the 12.1 RPI image in qemu. So I have the 12.1 image installed to my sd card and another image booted up inside a qemu instance. I am using distcc, which seems to be working. However, it consistently failed while compiling at this point.

`make -j6 CC=/usr/local/bin/distcc buildworld buildkernel`


```
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:1396:3: error: cannot compile this __builtin_init_dwarf_reg_size_table yet
  __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
distcc[74549] ERROR: compile /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c on localhost failed
*** [unwind-dw2.o] Error code 1

make[4]: stopped in /usr/src/gnu/lib/libgcc
1 error

make[4]: stopped in /usr/src/gnu/lib/libgcc
*** [gnu/lib/libgcc__PL] Error code 2

make[3]: stopped in /usr/src
--- lib/libcompiler_rt__PL ---
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/src/lib/libcompiler_rt
*** [lib/libcompiler_rt__PL] Error code 2

make[3]: stopped in /usr/src
2 errors

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

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

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

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

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

make: stopped in /usr/src
1 error

make: stopped in /usr/src
```

Which is similar to this error, but I don't see a solution on this thread, which I can do in FreeBSD.









						Clang error: Cannot compile builtin function yet
					

I am compiling the linux kernel code which also contains the gcc libraries (separately added) with clang. I am stuck at the following error:  gcc/unwind-dw2.c:1336:3: error: cannot compile this




					stackoverflow.com
				




Thanks!


----------

