Image builder quick questions

Hi i'm new to the image builder and i own a APU2
i would like to build my own with:

  1. CONFIG_KERNEL_DEVMEM=y (not found this setting yet)
  2. ext4 (only can find fat)
  3. full memory 32gb card usage. (i think i found this setting)

i have the imagebuilder up and running but i have some questions:

  1. if i want to test something and flash the image to the device is it posible to break the device, due to wrong settings?
  2. is it posible to just open up the orginal image and change those things, because the orginal image has already the settings i know that work?

thanks in advance for your time, and have a great day!

Not possible with Image Builder. This is a change that requires kernel recompile, and Image Builder is just working with pre-compiled packages from official repositories

Afaik that is needed only if you want to do a BIOS upgrade (flashrom fails if this option is disabled) . Are you sure you need this?

ext4 image should be generated by default

you need to edit the config file manually since Image Builder has no interface to change this.
Afaik you can also just enlarge the partition manually later.

Open the .config file (it is a hidden file by default) in the folder you extracted the image builder in, and edit the line

CONFIG_TARGET_ROOTFS_PARTSIZE=

to have the size (in MB) you want, stay a little lower than the actual storage size, a 32GB flash card is like 31.5-31.8 GB in practice.

Afaik no, this device has a BIOS firmware, it is a mini PC.

Unless you do things that damage the BIOS firmware or chip

no, the settings you mentioned above are not in the image but in build settings.

4 Likes

amazing!!! fairly easy the only thing is the kernel version is offset so i cant install most packages.
But the bios is updated and it was in the right extention and the disk space is 30gb!

Someone know the keywords to change the kernel version? i really dont know where im searching for on google.

thanks in advance
you'r awsome!!!

That is a common problem for development snapshot.
Every week or so the kernel changes or is updated and you can't install packages that need kernel version sync.

Download again image builder to get latest kernel version (and do this again when in a week or so the kernel version in snapshot changes).

Another option is to switch to a stable release image builder, if the image builder of release 19.07 is too old for you, you can use the one for the Release Candidate of next release, which is not changing very often if at all
https://downloads.openwrt.org/releases/21.02.0-rc4/targets/x86/64/

1 Like

Actually the kernel hash changes with every daily build (the kernel version may or may not change), requiring a new set of kmod packages. The old kmod packages are only stored on the server for a week. After that in order to install anything that requires downloading a kmod, you will need to start over with a new snapshot build.

1 Like

From https://openwrt.org/releases/snapshot:

Ok, I see begining to see what I did wrong, and please correct my if I'm wrong because I trying to learn:p

This tutorial:

Am I using but this tutorial is only for snapshot builds? And with those you can't install packages after a week because the server don't store kmod packages any more, so to update you need to reinstall the image maker and compile a whole new build.

I was trying yesterday to compile a whole new build following that tutorial, took the whole day because the day before yesterday i compiled my very first build (that build that couldn't install packages because some packages required kmod packages and those are just stored on the server for a week ;))
The second build that I compiled the dumb *** me uploaded the whole .gz file into luci 🤦 so learned a thing or two, lost every setting and was only getting average 50kb/s after the reinstall....
And still turned out as a snapshot build :rofl:

But if I understand correctly I need to follow this tutorial:

And get the image builder from:
https://downloads.openwrt.org/releases/21.02.0-rc4/targets/x86/64/

??

Thanks for the advice so far I really appreciate it :slight_smile:

That is valid for any build/release:
Selecting a specific code revision

If all you want to do is create a firmware image with a list of packages integrated in it, yes you should use Image Builder.

It is much faster than compiling from source because it is not compiling anything, it is downloading packages from OpenWrt download servers, and just creating the firmware images.

If you use the Image Builder from a Stable release you will not have that problem with kernel version/modules.

The link I gave you is the latest stable release, it is technically a release candidate so something may change from now to final release, but it is very little. It will not change kernel every week so it should not give you that problem.

In the instructiuons I gave you above, when I talked about CONFIG_TARGET_ROOTFS_PARTSIZE= I was talking about the Image Builder, so you can do the same change there too.

1 Like

Is there any other interesting option to change in Image Builder?

i end up only changing the 2 most wanted options in the .config for the APU 2
CONFIG_KERNEL_DEVMEM=y
and
CONFIG_TARGET_OPTIMIZATION=”-Os -pipe -march=btver2“

i can't change the CONFIG_TARGET_ROOTFS_PARTSIZE because if i do that the flashable .img become the same size, and everything is being build in ram and on hyperv i cannot go over the 8gb ram :blush: is someone knows the solution to compact the flashable img down to 250 mb that would be great.

thanks for all the help everything works now :smile: the only weird thing is that in the config alle the LUCI packages are enabled. but after flashing LUCI wasnt be found anyware. so:

ssh root@192.168.1.1 
no password yet ofc
opkg update
opkg install luci

Ending up use"ing"(my grammar is really bad,sorry) a flashable debian strick, so everytime i'm updating i need to get it of the wall and do this trick below (only works with ext4 images!).

boot to debian than:
Login as username user and password live

and than just:

apt-get update
apt-get install parted
parted list disk 
than with the right disk mine was sda
parted /dev/sda print
parted /dev/sda resizepart 2 28G
resize2fs /dev/sda2
and if there is a error you need to use the code from the error and after that you can rezize2fs


parted /dev/sda print:

Model: ATA SATA SSD (scsi)
Disk /dev/sda: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      262kB   17.0MB  16.8MB  primary  ext2         boot
 2      17.3MB  286MB   268MB   primary

Wouldn't doing that cause a 32GB file to be generated?

Depends if gzip option is enabled it's is way smaller. Gzips are way smaller, builded a 15gb ext4 openwrt img ending up with a 10mb gzip file.

But for ext4 you still need the size of the ext4 format in ram size.

I haven't found a solution for the bigger images, i only have 18gb ram available :blush: even setup a swap storage with the hope if the ram runs out of storage, it will use that storage to end the build.

But still got the error that the size is to big :blush:

Edit: I read literally now that swapon needs to be enabled each startup so I gonna try that again.

And found out that nano full builds don't generate ext4 builds, because a weird error while building. It needs to be installed differently, I don't understand it fully but on this forum is more information about some packages :slight_smile:

Instead of entering a full size of the SD, I enter a size slightly larger, say 400MB, than the space required by the packages. Then I resize the partition with gparted.

I did the same thing, but there is a quirky thing inside apu2 that after installing and using parted the /dev/sda1 can't being altered without reformating,
So you would need make a new partition to use the rest of the disk size.

So I used a external USB with debian or gparted to resize the disk externally, but it's a hassle to do because I needed a serial connection to make it happen and the router isn't on a accessable location.

So now I build it with a bigger size, also i learn a lot doing it but there is still a lot that i don't know

And installing from debian isn't really a option anymore because I need a vlan on the wan port else I have no internet access, that why i gonna try it with a openwrt USB as backup if something is going wrong.

Of course. To resize the partition I use the same PC where I created the image.