[RFC] fff-config: Remove migration script from V1 to V2

Submitted by Adrian Schmutzler on March 21, 2019, 12:57 p.m.

Details

Message ID 20190321125742.1575-1-freifunk@adrianschmutzler.de
State Rejected
Headers show

Commit Message

Adrian Schmutzler March 21, 2019, 12:57 p.m.
In V2, the /etc/config/fff file was introduced. Thus,
conversion from the old /etc/config/system was required.

Nowadays, where the vast majority of V1 devices are updated,
this script can be dropped. This also saves us from the
config-recreation performed there.

Note:
V1 routers updated after that should use sysupgrade -n, as
otherwise the old /etc/config/system will remain until the next
update.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 src/packages/fff/fff-config/Makefile               |  3 +--
 .../etc/uci-defaults/05-config-system-migration    | 27 ----------------------
 2 files changed, 1 insertion(+), 29 deletions(-)
 delete mode 100644 src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-config/Makefile b/src/packages/fff/fff-config/Makefile
index 89bdc93d..0ea4a798 100644
--- a/src/packages/fff/fff-config/Makefile
+++ b/src/packages/fff/fff-config/Makefile
@@ -1,8 +1,7 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-config
-PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration b/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration
deleted file mode 100644
index fe4ad978..00000000
--- a/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration
+++ /dev/null
@@ -1,27 +0,0 @@ 
-#!/bin/sh
-
-if [ ! -s /etc/config/fff ] ; then
-
-	UPGRADE_hostname=$(uci -q get "system.@system[0].hostname")
-	UPGRADE_description=$(uci -q get "system.@system[0].description")
-	UPGRADE_latitude=$(uci -q get "system.@system[0].latitude")
-	UPGRADE_longitude=$(uci -q get "system.@system[0].longitude")
-	UPGRADE_position_comment=$(uci -q get "system.@system[0].position_comment")
-	UPGRADE_contact=$(uci -q get "system.@system[0].contact")
-
-	/bin/rm -rf /etc/config/system
-	
-	/bin/config_generate
-
-	touch /etc/config/fff
-
-	uci -q set fff.system=fff
-	test -n "${UPGRADE_hostname}" && uci -q set "fff.system.hostname=${UPGRADE_hostname}"
-	test -n "${UPGRADE_description}" && uci -q set "fff.system.description=${UPGRADE_description}"
-	test -n "${UPGRADE_latitude}" && uci -q set "fff.system.latitude=${UPGRADE_latitude}"
-	test -n "${UPGRADE_longitude}" && uci -q set "fff.system.longitude=${UPGRADE_longitude}"
-	test -n "${UPGRADE_position_comment}" && uci -q set "fff.system.position_comment=${UPGRADE_position_comment}"
-	test -n "${UPGRADE_contact}" && uci -q set "fff.system.contact=${UPGRADE_contact}"
-
-	uci -q commit fff
-fi

Comments

Fabian Blaese May 31, 2019, 4:46 p.m.
Hallo Adrian,

das Skript tut uns derzeit nicht weh, ich würde es noch einige Zeit drin lassen.

Gruß
Fabian

On 21.03.19 13:57, Adrian Schmutzler wrote:
> In V2, the /etc/config/fff file was introduced. Thus,
> conversion from the old /etc/config/system was required.
> 
> Nowadays, where the vast majority of V1 devices are updated,
> this script can be dropped. This also saves us from the
> config-recreation performed there.
> 
> Note:
> V1 routers updated after that should use sysupgrade -n, as
> otherwise the old /etc/config/system will remain until the next
> update.
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  src/packages/fff/fff-config/Makefile               |  3 +--
>  .../etc/uci-defaults/05-config-system-migration    | 27 ----------------------
>  2 files changed, 1 insertion(+), 29 deletions(-)
>  delete mode 100644 src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration
> 
> diff --git a/src/packages/fff/fff-config/Makefile b/src/packages/fff/fff-config/Makefile
> index 89bdc93d..0ea4a798 100644
> --- a/src/packages/fff/fff-config/Makefile
> +++ b/src/packages/fff/fff-config/Makefile
> @@ -1,8 +1,7 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=fff-config
> -PKG_VERSION:=1
> -PKG_RELEASE:=1
> +PKG_RELEASE:=2
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
>  
> diff --git a/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration b/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration
> deleted file mode 100644
> index fe4ad978..00000000
> --- a/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -#!/bin/sh
> -
> -if [ ! -s /etc/config/fff ] ; then
> -
> -	UPGRADE_hostname=$(uci -q get "system.@system[0].hostname")
> -	UPGRADE_description=$(uci -q get "system.@system[0].description")
> -	UPGRADE_latitude=$(uci -q get "system.@system[0].latitude")
> -	UPGRADE_longitude=$(uci -q get "system.@system[0].longitude")
> -	UPGRADE_position_comment=$(uci -q get "system.@system[0].position_comment")
> -	UPGRADE_contact=$(uci -q get "system.@system[0].contact")
> -
> -	/bin/rm -rf /etc/config/system
> -	
> -	/bin/config_generate
> -
> -	touch /etc/config/fff
> -
> -	uci -q set fff.system=fff
> -	test -n "${UPGRADE_hostname}" && uci -q set "fff.system.hostname=${UPGRADE_hostname}"
> -	test -n "${UPGRADE_description}" && uci -q set "fff.system.description=${UPGRADE_description}"
> -	test -n "${UPGRADE_latitude}" && uci -q set "fff.system.latitude=${UPGRADE_latitude}"
> -	test -n "${UPGRADE_longitude}" && uci -q set "fff.system.longitude=${UPGRADE_longitude}"
> -	test -n "${UPGRADE_position_comment}" && uci -q set "fff.system.position_comment=${UPGRADE_position_comment}"
> -	test -n "${UPGRADE_contact}" && uci -q set "fff.system.contact=${UPGRADE_contact}"
> -
> -	uci -q commit fff
> -fi
>
Adrian Schmutzler May 31, 2019, 8:22 p.m.
Okay, Patch kann dann weg.

 

From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf Of Fabian Bläse
Sent: Freitag, 31. Mai 2019 18:47
To: Adrian Schmutzler <freifunk@adrianschmutzler.de>; franken-dev@freifunk.net
Subject: Re: [RFC PATCH] fff-config: Remove migration script from V1 to V2

 

Hallo Adrian, 

das Skript tut uns derzeit nicht weh, ich würde es noch einige Zeit drin lassen. 

Gruß 
Fabian 

On 21.03.19 13:57, Adrian Schmutzler wrote: 
> In V2, the /etc/config/fff file was introduced. Thus, 
> conversion from the old /etc/config/system was required. 
> 
> Nowadays, where the vast majority of V1 devices are updated, 
> this script can be dropped. This also saves us from the 
> config-recreation performed there. 
> 
> Note: 
> V1 routers updated after that should use sysupgrade -n, as 
> otherwise the old /etc/config/system will remain until the next 
> update. 
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de <mailto:freifunk@adrianschmutzler.de> > 
> --- 
>  src/packages/fff/fff-config/Makefile               |  3 +-- 
>  .../etc/uci-defaults/05-config-system-migration    | 27 ---------------------- 
>  2 files changed, 1 insertion(+), 29 deletions(-) 
>  delete mode 100644 src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration 
> 
> diff --git a/src/packages/fff/fff-config/Makefile b/src/packages/fff/fff-config/Makefile 
> index 89bdc93d..0ea4a798 100644 
> --- a/src/packages/fff/fff-config/Makefile 
> +++ b/src/packages/fff/fff-config/Makefile 
> @@ -1,8 +1,7 @@ 
>  include $(TOPDIR)/rules.mk 
>  
>  PKG_NAME:=fff-config 
> -PKG_VERSION:=1 
> -PKG_RELEASE:=1 
> +PKG_RELEASE:=2 
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) 
>  
> diff --git a/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration b/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration

> deleted file mode 100644 
> index fe4ad978..00000000 
> --- a/src/packages/fff/fff-config/files/etc/uci-defaults/05-config-system-migration 
> +++ /dev/null 
> @@ -1,27 +0,0 @@ 
> -#!/bin/sh 
> - 
> -if [ ! -s /etc/config/fff ] ; then 
> - 
> -     UPGRADE_hostname=$(uci -q get "system.@system[0].hostname <mailto:system.@system[0].hostname> ") 
> -     UPGRADE_description=$(uci -q get "system.@system[0].description <mailto:system.@system[0].description> ") 
> -     UPGRADE_latitude=$(uci -q get "system.@system[0].latitude <mailto:system.@system[0].latitude> ") 
> -     UPGRADE_longitude=$(uci -q get "system.@system[0].longitude <mailto:system.@system[0].longitude> ") 
> -     UPGRADE_position_comment=$(uci -q get "system.@system[0].position_comment <mailto:system.@system[0].position_comment> ") 
> -     UPGRADE_contact=$(uci -q get "system.@system[0].contact <mailto:system.@system[0].contact> ") 
> - 
> -     /bin/rm -rf /etc/config/system 
> -     
> -     /bin/config_generate 
> - 
> -     touch /etc/config/fff 
> - 
> -     uci -q set fff.system=fff 
> -     test -n "${UPGRADE_hostname}" && uci -q set "fff.system.hostname=${UPGRADE_hostname}" 
> -     test -n "${UPGRADE_description}" && uci -q set "fff.system.description=${UPGRADE_description}" 
> -     test -n "${UPGRADE_latitude}" && uci -q set "fff.system.latitude=${UPGRADE_latitude}" 
> -     test -n "${UPGRADE_longitude}" && uci -q set "fff.system.longitude=${UPGRADE_longitude}" 
> -     test -n "${UPGRADE_position_comment}" && uci -q set "fff.system.position_comment=${UPGRADE_position_comment}" 
> -     test -n "${UPGRADE_contact}" && uci -q set "fff.system.contact=${UPGRADE_contact}" 
> - 
> -     uci -q commit fff 
> -fi 
>