# Creating .img file for ARM(x) step by step.



## bsaidus (Jul 26, 2021)

Hello.
I succesfully compiled FreeBSD for ARM6 and ARM7 to install them on Raspberry Pi (3 or 4 ).
`make TARGET_ARCH=armv6 buildworld __SRCCONF=/mnt/config/uc_src.conf __MAKE_CONF=/mnt/config/uc_make.conf DESTDIR=/mnt/armv6uccen_frsh`
`make TARGET_ARCH=armv6 buildkernel KERNCONF=UCCENRPIB __SRCCONF=/mnt/config/uc_src.conf __MAKE_CONF=/mnt/config/uc_make.conf DESTDIR=/mnt/armv6uccen_frsh`

The `UCCENRPIB` is a copy of `RPI-B` kernel config.


The current question for Me is to create a memory disk, mount it and create partitions.
# create a zero filled file arm6_5g.img with 5GB.
`dd if=/dev/zero of=arm6_5g.img count=10240000`
# mount a file as memory disk
`mdconfig -a -t vnode -f arm6_5g.img -u 0`
Now I must create with `gpart` all necessary partition on it .
then mount ROOT partition and install my world & kernel in it.
Do modify what necessary and burn it on Stick.
But I've never tested or Played with RASPBERRY Pi.
Some one could point me to the wright point ( How to Create partitions and configure theme ( for FreeBSD i386 & AMD64 it's OK )?

Thank you.

PS: I've downloaded the prebuild FreeBSD 12.2 .img(s) and mount theme but I saw that in `/etc/fstab` there is a MSDOS partitions.

Help me please


----------



## bsaidus (Jul 26, 2021)

Waw, I've find somethings in /usr/src/release/tools.
Do you recommend read them?


----------



## mark_j (Jul 26, 2021)

Look at crochet, it has all the processing in it to build images for these devices.


----------



## T-Daemon (Jul 26, 2021)

Better read release(7) and have a look at

 /usr/src/release/

```
arm/
arm64/
release.conf.sample
release.sh
```


----------



## acheron (Jul 26, 2021)

FWIW, it's armv6 and armv7 not arm6 arm7.


----------



## Phishfry (Jul 27, 2021)

Maybe you can glean a bit of information from my cross-compile post.








						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


----------



## bsaidus (Jul 27, 2021)

Thanks you very welle for your help.
I'll informe you later for the results.


----------



## Phishfry (Jul 29, 2021)

I borrowed heavily from this wki:


			arm/Raspberry Pi 2 image - FreeBSD Wiki


----------

