Customized sysupgrade image

How can i build a customized sysupgrade image?
I want to build a sysupgrade image what steps should i follow to create a sysupgrade?

There is the https://firmware-selector.openwrt.org/ that customizes Sysupgrade images for supported devices from pre-compiled Snapshot and Release versions.

You can also build from source see: https://openwrt.org/docs/guide-developer/toolchain/start

2 Likes

There are many ways actually:

  1. The easier: Install luci-app-attendedsysupgrade (on Luci > System > Software). After that, go in Luci > System > Attended Sysupgrade and search for firmware upgrade. It will request a sysupgrade for your device with all the added packages you have and will install it preserving your configuration. If you reset to defaults, the packages will still be installed.
  2. Use the Firmware Selector. Input your model and then, you can click on "Customize installed packages and/or first boot script" and add or remove packages or even paste a custom script that gets executed on the first boot of the device.
  3. A bit more advanced: if you're on a stable version (22.03.x or 23.05.x) install auc and run it via SSH (https://openwrt.org/docs/guide-user/installation/attended.sysupgrade#auc). If you're on recent SNAPSHOTS, install owut (https://openwrt.org/docs/guide-user/installation/sysupgrade.owut). Both do the same as Luci Attended Sysupgrade but in a command line way. They make use of the ASU server to generate a customized image.
  4. Download an use the Image Builder. You download a .tar file with the image builder and run it on a linux box (or even WSL) and make a build with the packages you want. More info here: https://openwrt.org/docs/guide-user/additional-software/imagebuilder. It's almost as fast as the options above.
  5. Or use the build system like @RuralRoots said. There, you need to compile from source everything and depending on your computer it can take a long time.

There are plenty of options. Use what you're comfortable with.

Cheers!

5 Likes

thanks for the reply. I actually did start with the build system and that's what i need but i didn't find something that says the image will be built as a sysupgrade image, i know that sysupgrade image differ than an initial setup image or factory image as it omits bootloader, partitioning information but it contains kernel, user-packages and base system files. does that mean in the menuconfig menu should i omit these things and build, does this by default produces a sysupgrade image. and what if a device that is not and mtd but an emmc how can i deal with such devices.

what i want to do is to be able to build an image for devices that may not be supported by openwrt.
if i am not clear expressing my idea please have a little patience may be i am not choosing the correct wording.

This can't be done. If the device isn't supported by OpenWrt, the files that a produced by the OpenWrt build system will not work on said device.

Further, a sysupgrade image is typically used for a device that is already running OpenWrt. If the device isn't yet running OpenWrt, you likely need another type of image (such as initramfs or some other format) for the first install. But that still won't work if OpenWrt doesn't currently support the device.

You need to go through the process of adding support for a new device:
https://openwrt.org/docs/guide-developer/add.new.device

What device are you talking about here?

As @psherman explains, the build system is tailored to building supported devices only.

Based on a supported device’s Target/SubTarget/Profile for the device the build system will build the requisite images typically initramfs, factory, and sysupgrade images.

i don't have a specific device, but i've been exploring the sysupgrade script `this script and i traced it and found that at some point there are functions like

nand_do_upgrade, RAMFS_COPY_BIN and RAMFS_COPY_DATA

where these functions are called from platform.sh script which is checked if it exists by `this script

so i was wondering if i could tweek these functions to deal with custom devices
as long as i know the sysupgrade image components and how to build a sysupgrade image but customize this image components to serve this purpose.
`

No. Each device requires a bespoke firmware image because the hardware is not generic.

Don't conflate sysupgrade with general OpenWrt support. Those are two different things.

okay, so from where can i get more understanding about the components or sources used to build the sysupgrade image rather than just having a .bin image
i tried binwalk command on the sysupgrade image and get the output below


i thought if i am able to know what are the components in the sysupgrade image are i would be able to build the image independent without the other images produced by the build system.

does this script `here is used to with building the sysupgrade image or at what stage this script comes to a use.

What exactly does this mean? What is a sysupgrade image without the payload of the actual firmware that needs to be installed on the device?

Yes i understood you that a device first needs to have an already running openwrt image and the sysupgrade will be run on this device. I am asumming that a device already running openwrt let's say for example wallys dr4029 can i customize a sysupgrade image for it. By knowing what components makes the sysupgrade image can i use these sources to customize it.

Again, images need to be built for the specific hardware. So if your hardware is supported, sure, you can make a sysupgrade image. But if it's not, no you can't... there would be no payload for the image.

The DR40X9 is supported by the official OpenWrt project... what I don't know is if the X is a wildcard or if it is a specific model. If it's a wildcard, that would mean that the 4029 should be supported and thus you can make a sysupgrade image for it. If the X is a specific model, then your device is not supported.

This won’t do you much good, but the target depicted in make nconfig/menuconfg is Target System (Qualcomm Atheros IPQ40XX), the SubTarget is generic, the target profile is your guess. If you select target profile Muiltiple the build system will produce binaries for all Supported Devices for target/profile combinations.

That being said, if your device isn’t supported and you apply whatever sysupgrade image it builds, you’ll likely end up with a brick with no way back.

so for the supported device as the wallys dr4029, based on the ipq40xx how can i know how the images are built, when i type make and the process begins and i get the following output at the bin directory
Screenshot from 2024-11-13 20-26-53
i still can't understand what makes these images what components are in these images or what makes an image an image.

The packages included in the built images are detailed in the manifest file.