[PATCH] base-files: sysupgrade: store status of system-services

Luiz Angelo Daros de Luca luizluca at gmail.com
Sun Jan 10 12:46:45 EST 2021


> When saving the list of installed pkgs, also store the status of the
> system services. The list is created in the etc/backup folder also
> and formated as:
>
> /etc/init.d/<service> {enable|disable}
>
> This way it can be sourced after sysupgrade, to restore the previous
> state.

I also liked the idea. I didn't like the use of -k option (save a list
of installed packages). I would either create a new option for it,
enable it when -c or -o is in use, or simply enable it by default.

I also think that ${SERVICE_STATUS} could be executed by default after
the reboot. If the user asked to preserve service status, it could be
implicitly assumed that the user wants to restore it after the backup
is applied. The problem is that you cannot write directly to
/etc/uci-defaults without touching the flash on each backup. The
/etc/backup is a good solution but you need to change when it is
mounted, and not only when '-k' is selected.

I would create a new /etc/uci-defaults/01-post-restore.sh provided by
base-files (and not created by a backup) that would read a possible
/etc/backup/post-restore.sh script. There you could place your
enable/disable calls.

Regards,

Luiz Angelo



More information about the openwrt-devel mailing list