-
Notifications
You must be signed in to change notification settings - Fork 31
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
ff3l-badblocks-disable-autoupdater: init #125
Open
kpanic23
wants to merge
1
commit into
freifunk-gluon:master
Choose a base branch
from
kpanic23:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+55
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,31 @@ | ||||||
include $(TOPDIR)/rules.mk | ||||||
|
||||||
PKG_NAME:=ff3l-badblocks-disable-autoupdater | ||||||
PKG_VERSION:=1 | ||||||
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | ||||||
|
||||||
include ../../../package/gluon.mk | ||||||
|
||||||
define Package/ff3l-badblocks-disable-autoupdater | ||||||
SECTION:=gluon | ||||||
CATEGORY:=Gluon | ||||||
TITLE:=Disable autoupdater if device has bad eraseblocks | ||||||
endef | ||||||
|
||||||
define Build/Prepare | ||||||
mkdir -p $(PKG_BUILD_DIR) | ||||||
endef | ||||||
|
||||||
define Build/Configure | ||||||
endef | ||||||
|
||||||
define Build/Compile | ||||||
$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) | ||||||
endef | ||||||
|
||||||
define Package/ff3l-badblocks-disable-autoupdater/install | ||||||
$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ | ||||||
endef | ||||||
|
||||||
$(eval $(call BuildPackage,ff3l-badblocks-disable-autoupdater)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not 100% sure, but I think you can remove L16 to L29 and use
Suggested change
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ff3l-badblocks-disable-autoupdater | ||
============= | ||
|
||
Transitional package to be used with last Gluon v2019.1.x release | ||
Simply disables the autoupdater for UBNT ERX devices with bad eraseblocks in flash and prefixes the node's name with "#BADBLOCKS". | ||
This mitigates the issue that these devices would get bricked by an update to Gluon v2020.1 or newer, where the handling of bad eraseblocks has been changed. | ||
(see: https://github.com/oszilloskop/UBNT_ERX_Gluon_Factory-Image/blob/master/ERX-Sysupgrade-Problem.md) |
17 changes: 17 additions & 0 deletions
17
...-badblocks-disable-autoupdater/luasrc/lib/gluon/upgrade/590-badblocks-disable-autoupdater
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/lua | ||
local uci = require('simple-uci').cursor() | ||
local eraseblock = io.popen("dmesg|grep \"Bad eraseblock\""):read('*a') | ||
local hostname = uci:get_first('system', 'system', 'hostname') | ||
if (eraseblock ~= '') then | ||
io.write('has badblocks, disabling autoupdater...\n') | ||
uci:set('autoupdater', 'settings', 'enabled', '0') | ||
uci:save('autoupdater') | ||
if hostname:find('BADBLOCKS') then | ||
io.write('already prefixed\n') | ||
else | ||
io.write('changing hostname to "#BADBLOCKS '..hostname..'"...\n') | ||
io.popen('pretty-hostname "#BADBLOCKS '..hostname..'"') | ||
end | ||
else | ||
io.write('no badblocks\n') | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we make sure that this package does nothing on later releases? Can we somehow check the current version and if >2019 just don't add any files?