# Where is the sysupgrade.bin output filename defined?

Hi all.

The current snapshot sysupgrade.bin file for the bt homehub v5a has the following filename:

`openwrt-lantiq-xrx200-bt_homehub-v5a-squashfs-sysupgrade.bin`

My question is: where, in the build procedure code, is this output filename defined?

I assumed that is was in a make file somewhere, so I have had a good dig around inside:

https://github.com/openwrt/openwrt/tree/master/target/linux/lantiq

and I've concluded that it's something along the lines of:

`openwrt-<BOARD>-<SUBTARGET>-<TARGET_DEVICE>-squashfs-sysupgrade.bin`

with:
BOARD:=lantiq (from target/linux/lantiq/Makefile#L7)
SUBTARGET:=xrx200 (from target/linux/lantiq/xrx200/target.mk#L2)
TARGET_DEVICES += bt_homehub-v5a (from target/linux/lantiq/image/vr9.mk#L180)

So I think that I have found the "assignments", but I can't find the "expression":

`openwrt-<BOARD>-<SUBTARGET>-<TARGET_DEVICE>-squashfs-sysupgrade.bin`

Could anyone (who understands the build process) explain where this filename is defined? (My "make-fu" is weak!) Thank you.

Thank you for replying, but I still can't see the connection.

Just for example, the ".bin" file extension on the end of `openwrt-lantiq-xrx200-bt_homehub-v5a-squashfs-sysupgrade.bin`. I can't find where that file extension is defined. It certainly doesn't appear to be in image.mk#L36-L42 or in Config-devel.in#L48-L54 or in image-config.in#L146-L267 (the latter 2 references are from your "See also").

(Please understand that I'm only giving the file extension, bin, as an example of a literal string that I can't find - I don't want to change it, I just want to find it and learn more about the build process as I go.)

I'm starting to think that the output filename may be defined somewhere under target/linux/lantiq/image but I'm still not sure.

The prefix generation is described above, while the suffix is target/device-specific:

The prefix and suffix are combined as the device image:

`sysupgrade.bin` here