Several ways to build the system - dervishe-/GenBerry GitHub Wiki

You can build the Gentoo system following three different ways:

Use a device

Plug a sdcard in your computer and execute the script. At the end, you will have a working system on the card. Just plug the card in the raspberry, boot and voilà ! Well, you have one or two steps to do after the first boot.

If you just have to make one card, you should use this solution.

For this method, you will have to use the -d option to specify your sdcard location if it's not /dev/mmcblk0 (the default value).

sudo GenBerry -d /dev/YOUR_DEVICE

Create an image to burn

The script will build for you an image to put on a sdcard with dd. The size of the sdcard is fixed in the parameter of the script. This solution use loop devices. You will have to resize the main partition to fit the size of the sdard with for instance *parted.

If you have a lot of cards to do, you could use this solution. Generate an image one time and burn it on each card.

For this method, you will have to use the --use-image option:

sudo GenBerry --use-image

The image location is in the work directory and is name is: GenBerry_{card_version}-{mode}.img. For instance, if you select a rPi 4 with a 32 bit system, the name will be: GenBerry_4-32.img.

To verify the image after the creation:

sudo losetup -fP yourImage.img

The you will have /dev/loopXpY partitions that you can mount.

Create a tarball

The script will generate the complete system for you and make a tarball with it located in the work directory with the name GenBerry_{card_version}-{mode}.tar.xz. As there's no sdcard provided, you will have to provide a valid fstab file to the script via the -F option. Once the tarball generated, you have to partition your sdcard, format it according to your fstab file and mount it. Then you just have to expand the tarball in the card.

If you want to tune the partitions, with a lot of card to do and don't want (as the previous solution) to expand the partition and filesystem, you could use this solution.

This solution provide also the lightest result between the three methods for the size, the best way to share it over a network.

For this method, you will have to use the --use-tarball and -F options:

sudo GenBerry --use-tarball -F /YOUR/FSTAB_FILE

Once your sdcard properly mounted on your host just type:

tar -xJpf your_tarball.tar.xz -C /your/mountpoint