tessel / openwrt-tessel

OpenWrt build scripts and package feed for Tessel 2
Other
32 stars 14 forks source link

Sysupgrade sets hostname to default #19

Closed johnnyman727 closed 8 years ago

johnnyman727 commented 9 years ago

Still need to figure out why/when this happens.

kevinmehall commented 9 years ago

Do other settings like WiFi also get reset when this happens?

Are you updating from a build before the hostname was set to Tessel-MACADDR on first boot? In that case, the script would run once.

johnnyman727 commented 9 years ago

@kevinmehall I'll have to test to confirm but I believe they do get reset when this happens. I've also seen the authorized_keys be deleted.

Are you updating from a build before the hostname was set to Tessel-MACADDR on first boot? In that case, the script would run once.

Ah so this issue, in theory, would only happen once per Tessel (that had sufficiently old hardware)? I'm pretty sure this isn't the case but I'll need to test it.

johnnyman727 commented 9 years ago

So I just modified this file to a custom string and updated a Tessel that has previously had it's hostname set to Tessel-MACADDR and it did set that hostnamee.

@kevinmehall was your understanding that the scripts in uci-default would run only once? It seems like that isn't the case here.

johnnyman727 commented 9 years ago

After talking with Kevin, we decided the best way to do this is to modify /etc/config/system with a property that indicates that the name was set (or remove an option to auto-set on boot). The CLI will then modify that property when rename is called. Finally, we'll need to modify the hostname setting file so that it checks the state of that property. So this fix will be a PR on both t2-cli and openwrt-tessel.

rwaldron commented 9 years ago

@johnnyman727 yesterday @HipsterBrown and I discussed the issue of restoring a custom name as well and we both agreed that saving the original name and custom name to a file in the ~/.tessel/ dir is completely reasonable. There should never actually be any conflict and if users tamper with the file, that's their problem to resolve, not the cli tool. Why is modifying /etc/config/system preferable?

rwaldron commented 9 years ago

@johnnyman727 yesterday @HipsterBrown and I discussed the issue of restoring a custom name as well and we both agreed that saving the original name and custom name to a file in the ~/.tessel/ dir is completely reasonable. There should never actually be any conflict and if users tamper with the file, that's their problem to resolve, not the cli tool. Why is modifying /etc/config/system preferable?

(Note that this is w/r to the cli's t2 rename and following a t2 update command)

johnnyman727 commented 9 years ago

@rwaldron it's preferable because it allows the Tessel to take care of naming itself and isn't dependent on any particular host machine. Also, what if you use multiple Tessels - how do you keep track of which has which name?

rwaldron commented 9 years ago

The former is the compelling reason (no specific host). The latter is trivial: the file would contain original:new for all tessels renamed, but that's moot because your first reason is the best reason

wyze commented 8 years ago

This was fixed in #59.