Creating bootable img for Debian

Hey forum,

I’m trying to create a flashable/bootable .img file for my current Debian with some modifications. I’ve changed something under /usr/lib and kernel for Rock5B and I want to create a bootable image with these updated directories.
Currently, I’m trying to follow https://wiki.radxa.com/Rock5/dev/Debian#Build_kernel document but not sure if that is what I want and it gives me not supported errors in building u-boot step.

Any help is appreciated :slight_smile:

Thanks

Those docs are bit old now, radxa switched to rbuild and github, just view their repository and build scripts:

Also You may be interested in Armbian, it’s prepared to build system, kernels and make Your own customisations for burned images. Yet again view their docs, clone repo and play with it.

Hey @dominik, appreciate the reply.
I’ve checked out the documentation but it is disabled for ROCK5B, does that mean I can’t use it?
I need it for specifically Debian instead of Armbian.

what is disabled? rbuild or armbian?

ROCK5B section in documentation inside of the rbuild repo is disabled.
https://radxa-doc.github.io/quick-start/download.html

ok, You browsed something that may be some work in progress, maybe unfinished and left
Check out github workflows: https://github.com/radxa-repo/rbuild/blob/main/.github/workflows/build.yaml
this is used to build images, You can check all scripts and sources there

Just to clear my purpose before I look into it. I’m trying to create a bootable .img with my current running Debian system including any libraries or directories I’ve added. Is that what it is for?

It’s workflow for creating bootable images. You can fork it and do whatever customisations You want resulting in Your own image.

dominik, I’m afraid I couldn’t understand anything regarding rbuild and its documentation.

1 Like

rbuild is as debian as armbian is debian. Or none are Debian. Now choose.

@RadxaYuntian please give a guide

You can just dump the image out and it can be used on other systems.

Thanks RadxaYuntian, that was my initial goal but it seems it dumps whole system and it has the size of eMMC module, right? Is there any way to reduce to size only containing files like 2-3 GB?

After dumping the image you can shrink the root partition with resize2fs, then update the partition table to use the new size. You can then trim the space after the end of root partition.

Above is provided as ./rbuild shrink-image xxx.img command.