Custom version identifier for custom firmware

Hey everyone, I saw a few posts online about this topic, for example this one. I modified the package/base-files/image-config.in file (I modified the lines 153-265) and compiled, but nothing changes after I flashed the resulting image.
It still shows the openwrt defaults when I look inside the flashed board's /etc/openwrt_release file.

Why are the openwrt defaults still being used instead?

you made some changes you're not showing us, and now you want us to solve the problem for you.

is that an accurate summary ?

Let me know what is relevant and I can show you...
All I did was change the string fields inside image-config.in

how about you post them ?

Lines 153 to 265 is where I made the changes:

menuconfig VERSIONOPT
	bool "Version configuration options" if IMAGEOPT
	default y
	help
		These options allow to override the version information embedded in
		the /etc/openwrt_version, /etc/openwrt_release, /etc/banner,
		/etc/opkg.conf, and /etc/os-release files. Usually there is no need
		to set these, but they're useful for release builds or custom OpenWrt
		redistributions that should carry custom version tags.

if VERSIONOPT

	config VERSION_DIST
		string "nice"
		prompt "Release distribution"
		default "OpenWrt"
		help
			This is the name of the release distribution.
			If unspecified, it defaults to OpenWrt.

	config VERSION_NUMBER
		string "b1.0"
		prompt "Release version number"
		help
			This is the release version number embedded in the image.
			If unspecified, it defaults to SNAPSHOT for the master branch
			or to ##.##-SNAPSHOT on release branches.

	config VERSION_CODE
		string
		prompt "Release version code"
		help
			This is the release version code embedded in the image.
			If unspecified, it defaults to a revision number describing the
			repository version of the source, e.g. the number of commits
			since a branch point or a short Git commit ID.

	config VERSION_REPO
		string
		prompt "Release repository"
		default "https://downloads.openwrt.org/releases/23.05-SNAPSHOT"
		help
			This is the repository address embedded in the image, it defaults
			to the trunk snapshot repo; the url may contain the following placeholders:
			 %R .. Repository revision ID
			 %V .. Configured release version number or "SNAPSHOT", uppercase
			 %v .. Configured release version number or "snapshot", lowercase
			 %C .. Configured release revision code or value of %R, uppercase
			 %c .. Configured release revision code or value of %R, lowercase
			 %D .. Distribution name or "OpenWrt", uppercase
			 %d .. Distribution name or "openwrt", lowercase
			 %T .. Target name
			 %S .. Target/Subtarget name
			 %A .. Package architecture
			 %t .. Build taint flags, e.g. "no-all busybox"
			 %M .. Manufacturer name or "OpenWrt"
			 %P .. Product name or "Generic"
			 %h .. Hardware revision or "v0"

	config VERSION_HOME_URL
		string ""
		prompt "Release Homepage"
		help
			This is the release version homepage

	config VERSION_MANUFACTURER
		string "nice"
		prompt "Manufacturer name"
		help
			This is the manufacturer name embedded in /etc/device_info
			Useful for OEMs building OpenWrt based firmware

	config VERSION_MANUFACTURER_URL
		string ""
		prompt "Manufacturer URL"
		help
			This is an URL to the manufacturer's website embedded in /etc/device_info
			Useful for OEMs building OpenWrt based firmware

	config VERSION_BUG_URL
		string
		prompt "Bug reporting URL"
		help
			This is an URL to provide users for providing bug reports

	config VERSION_SUPPORT_URL
		string
		prompt "Support URL"
		help
			This an URL to provide users seeking support

	config VERSION_PRODUCT
		string "Simple AP"
		prompt "Product name"
		help
			This is the product name embedded in /etc/device_info
			Useful for OEMs building OpenWrt based firmware

	config VERSION_HWREV
		string "v1"
		prompt "Hardware revision"
		help
			This is the hardware revision string embedded in /etc/device_info
			Useful for OEMs building OpenWrt based firmware

	config VERSION_FILENAMES
		bool
		prompt "Version number in filenames"
		default y
		help
			Enable this to include the version number in firmware image, SDK-
			and Image Builder archive file names

My question is, are there any other files I should edit for these changes to take effect? because as it stands, they do not reflect in the compiled images.

AFAIK you shouldn't be directly editing that file. It's used to provide the options within the config menu you get by running make menuconfig. You need to run that command, add 'Image Configuration' by pressing Y and you can then go into it to change the various options.

4 Likes

Set it up in your nconfig/menuconfig.
Set CONFIG_VERSIONOPT=y and CONFIG_IMAGEOPT=y in your .config.

In menuconfig select Image configuration and enter the Image configuration submenu where you can see all the branding options.

3 Likes

I was interpreting it all wrong then!! This seems much more solid, I am compiling it now, should be all right! Thank you @krazeh and @RuralRoots

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