-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
realtek-poe: build default config from board.json #25551
base: master
Are you sure you want to change the base?
realtek-poe: build default config from board.json #25551
Conversation
utils/realtek-poe/Makefile
Outdated
$(INSTALL_BIN) $(PKG_BUILD_DIR)/realtek-poe $(1)/usr/bin/ | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/poe $(1)/etc/init.d/ | ||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/files/etc/config/poe $(1)/etc/config/ | ||
$(CP) ./files/etc/uci-defaults/30-poe $(1)/etc/uci-defaults/30-poe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this use some sort of INSTALL_
macro, so that the file is installed with the correct permissions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled the behavior from libreswan
, but yeah, there are certainly newer changesets showing the use of the INSTALL_BIN
macro -- e.g. commit 3219c50.
Adjusting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with the push of bb0fb2b.
This adjustment makes a compromise between those that would prefer not to complicate the realtek-poe.git source repository and those who want to have PoE work out-of-the-box on Realtek switches -- see realtek-poe.git, commit 2df137ee457155 ("realtek-poe/openwrt: Generate config from board.json") Switches previously booted with OpenWrt will have an /etc/config/poe file already present, and thus the uci-default shall not take effect. Signed-off-by: Martin Kennedy <[email protected]>
6d9ff0f
to
bb0fb2b
Compare
$(INSTALL_BIN) $(PKG_BUILD_DIR)/realtek-poe $(1)/usr/bin/ | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/poe $(1)/etc/init.d/ | ||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/files/etc/config/poe $(1)/etc/config/ | ||
$(INSTALL_BIN) ./files/etc/uci-defaults/30-poe $(1)/etc/uci-defaults/30-poe | ||
endef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The poe-common package also added a section to mark the config file as such. I don't quite remember what this means in terms of behaviour on upgrades etc, and I can't really find much documentation either.
define Package/poe-common/conffiles
/etc/config/poe
endef
From the opkg code, I think this results in detecting that the file exists and has been "modified" (created), thus doing The Right Thing (creating backup etc.) on package upgrades. I think the old package would just blindly replace the edited poe config file on upgrades. The uci-defaults script would do the same though, and won't touch the file if it already exists.
Hopefully this also means the config file is put in the config backup automatically on system upgrades, but you may have to check this.
Don't forget to bump PKG_RELEASE. |
Maintainer: me
Compile tested: (not yet)
Run tested: (not yet)
This adjustment makes a compromise between those that would prefer not to complicate the realtek-poe.git source repository and those who want to have PoE work out-of-the-box on Realtek switches -- see realtek-poe.git, commit 2df137ee457155 ("realtek-poe/openwrt: Generate config from board.json")
Switches previously booted with OpenWrt will have an /etc/config/poe file already present, and thus the uci-default shall not take effect.