Re: [OpenWrt-Devel] fstools / always fires 'uci commit' each reboot

2015-01-29 Thread Bastian Bittorf
* Lars Kruse li...@sumpfralle.de [29.01.2015 20:06]:
 or even better (this does not hide errors in block detect):
  [ -f /etc/config/fstab ] || block detect  /etc/config/fstab
 
 (I do not see the need for the subshell here - thus I removed the brackets)

thanks to jow, there was a hotfix with r44180 for this:
https://dev.openwrt.org/changeset/44180/trunk

bye, bastian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] fstools / always fires 'uci commit' each reboot

2015-01-28 Thread Bastian Bittorf
we detected a strange problem in our community-network,
which can be tracked down to
'package/system/fstools/files/fstab.default' which is later
installed to '/etc/uci-defaults/10-fstab' including this:

[ ! -f /etc/config/fstab ]  ( block detect  /etc/config/fstab )

in our routers there is always a '/etc/config/fstab', which
means this scripts fails and later during /etc/init.d/boot
an 'uci commit' is fired because of this, see uci_apply_defaults()

the intention is, to do an 'uci commit' because some scripts have
run in /etc/uci-defaults. this is always true when scripts will
not be deleted after firstrun and causes issues here:

we autoupload a cofiguration.tgz, when something had changed in
/etc/config and because we dynamically do some configurations
during bootup with 'uci set ...' there is always an upload
triggered.

the question is here:

1)
can we change that behaviour for this single script?
(delete it during first run).

or

2)
only fire an 'uci commit' when the checksum of /etc/config has changed?

i dont opened a ticket on tracker, because this is not a real bug.

bye, bastian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] fstools / always fires 'uci commit' each reboot

2015-01-28 Thread Lars Kruse
Hi,

 [..]
 1)
 can we change that behaviour for this single script?
 (delete it during first run).

I guess, that script's execution should be considered successful, even
if /etc/config/fstab already exists. Thus the author just failed to make sure
that the exit code of that script reflects this logic.

I would suggest that
 [ ! -f /etc/config/fstab ]  ( block detect  /etc/config/fstab )
should be changed to:
 [ ! -f /etc/config/fstab ]  block detect  /etc/config/fstab || true
or even better (this does not hide errors in block detect):
 [ -f /etc/config/fstab ] || block detect  /etc/config/fstab

(I do not see the need for the subshell here - thus I removed the brackets)

This would make sure that the script exits successfully if there is the fstab
file or if the block detect execution finished successfully. Thus the script
would be deleted after its first execution (as it should be).

Lars
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel