Building OpenWrt from scratch on raspberry pi 4

I am an openwrt newbie here. I am trying to

  1. build a custom image of openwrt with a python package that I have created
  2. Perform the build on Mac
  3. Expand the usable space to the full size of my memory card on Mac.

Most of the tutorials I have seen is for linux. Is there any reliable documentation to do this on Mac without using VirtualBox?

I do not understand why you don't use the firmware selector.

You can build it anyway you want by editing the Customize installed packages and/or first boot script.

And why you are not following the majority of advice in The Forum and expand the file system using a Linux box with gparted, Fdisk and the last Linux partition tool I cannot remember.
Seems to me you are asking us how to build it your way and not OpenWrt's way. It is your tree, use a hammer if you want.

Regardless:
I suggest you get an Industrial Grade sd card (their controllers have many features including built in wear leveling and much more over-provising; among other life extending features.

I, and OpenWrt, also suggest you ensure the Pi4 has the latest bootloader; you can DDGo however you prefer to do that.

1 Like

This IS NOT OFFICIALLY SUPPORTED

1 Like

..and will, undoubtedly, bring them back asking why something is not working.

For 1 and 2 - can you download an external toolchain for the official OpenWrt build system?
For 3 - I do not recommend resizing it yourself. Instead define the following in your .config which will be the size of the root partition. You can then manually partition any space after that as a data partition and it will survive re-imaging. Note mine is using 512 MB which is plenty for my use but you can modify it to fit yours:

CONFIG_TARGET_KERNEL_PARTSIZE=32
CONFIG_TARGET_ROOTFS_PARTSIZE=512
1 Like

That seems new.
It would be a lot easier on me. Does Squash or EXT4 matter?

I have always generated ext4 images for uSD cards so cannot speak to the squashfs option but I don't see why not.

I use EXT4; just asking if I would need to change.

Not sure why they offer SQUASH on fruit (Orange, Raspberry) Pis that have much more room than needed; well, this decade anyway. slight_smile:

Is there a Wiki on that or do you do that in the firstboot script?

You do it when you build the image. So it goes in the .config file for the build.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.