-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Define var using localstatedir and use rsync #4797
Conversation
Hi @publicarray and @hgy59, finally slowly coming back and revisiting this PR. |
@publicarray issue #4758 is due to "new" files being deployed under the EDIT: This PR do solve the issue for tvheadend and been working well, additional testers would be great to confirm all is ok. |
668f8df
to
4b326e3
Compare
@publicarray All changes are now in and all packages adjusted accordingly. I'll be running a few more tests of my own to confirm all is still ok for my regular packages. But in theory this should make all packages fully using target/../var directory for DSM => 7, from configure (with all proper switches) , to build then to install time. @hgy59 you where right, indeed it was worth splitting things over in separate PR as |
Now that #4854 is completed, I'm back to this pending PR. |
There is a caveat in the |
@hgy59 and @publicarray I was able to solve my last blocker to properly inherit copying while managing
I've ran quite a few tests with the
This is the next step into using natively the Synology DSM7 |
Unless all packages using EDIT: Revisiting this, makes no sense... too many use cases. Suggesting to declare them as not compatible for DSM7 until migrated to |
@hgy59 and @publicarray proposing the following change in |
When testing the package creation with spk/demoservice it appeared that files in staging/README was not being processed. This is due to the "-type d" option which only include directories, thus leaving files location at root of staging (e.g. target/) to be skipped.
Otherwise ends-up getting Cannot open: No such file or directory
Use tmp directory for DSM6-7 migration instead of moving right away to permanent storage as it is not available immediately when upgrading. Also, when copying over new target/_var/* files, any existing will be added suffix .new and rsync a second time so user will keep his existing but will have access to any new versions of the configuration file.
postupgrade now use the --backup in conjunction with --suffix=.new which will update any changed files with the previous copy and rename the file in place to .new so it can be used as reference for the user.
Hi fellow @SynoCommunity/developers , winter is coming and I would really much like to get this merged before spring break. Every smaller bits have been merged into other PR. Now whats left is the framework changes to fully handle Synology's new So overall I'm now begging to get a thumbs-up before merging so I can focus on other things afterwards (e.g. |
Motivation: Follow-up to #4579 with focus only on
var
. This includes migrating to usingrsync
for this new installation method intospksrc.service.installer.dsm7
.Current framework simply move files from
target/var
totarget/../var
at installation/upgrade time. While it's probably fine for most use-cases, in order to generate proper configuration files at compile time the "real" path must be given at configure time usinglocalstatedir
option. Doing so enforces the application to use by default the new DSM7var
directory and install and adjust path in configurations accordingly at build time. Not doing so leaves a bit of unknown on actual application state & behavior.Current limitations of spksrc fixed by this PR:
var
properly by default (e.g. at configure/compile time)var
during package upgrade overwriting existingtarget/../var
var
for user referenceThis PR aims at solving the current limitations by:
localstatedir
for DSM7 builds. At package generation time, files installed under<workdir>/install/var/package/<package>/var
are now be handled differently in order to be packaged and installed properly..new
suffix to configuration new files when previous ones already exist. User can then refer to them and adapt their own configuration as needed.Changes
1. @appdata (e.g. var)
The
package.tgz
only containstarget
directory (referred as@appstore
). The framework currently copies over thetarget/var
totarget/../var
directory. The limitation is that it doesn't change the configure options to make usage oflocalstatedir
so the application isn't built by default to be in a readiness state for using this new directory structure. Further more, it doesn't allow to provide updated files with proper path that the user could refer to during upgrades.This PR aim at working around that in order to fully use
var
(referred as@appdata
):localstatedir
configure option pointing to this/var/packages/<package>/var
by default_var
This PR creates the following new variables to be used at build time (backward compatible <= DSM6):
INSTALL_PREFIX_VAR
=/var/packages/<package/target/../var
-> Used for setting up thelocalstatedir
pathSTAGING_INSTALL_PREFIX_VAR
=work-*/install/....../target/../var
-> Used undercross/*
installationSTAGING_SPKVAR
-> Used for copying files directly to staging underwork-*/staging/_var
atspk
pre-packaging time2. spksrc.service.installer.dsm7 (rsync usage, merged part of #4997)
A few changes where made to the dsm7 installer script in order to
.../target/../var
.new
" suffix when files already exists under.../target/../var
in order to never overwrite user-configurations while still providing updated examples for reference.var
files gets lost due to missing@appdata
At the lower level it works such as:
rsync
instead ofcp
to copy filespreupgrade
, copy any "residual" DSM6 files from.../target/var/*
to a tmp directorypostupgrade
, copy any "residual" DSM6 files from tmp directory back to the new.../target/../var
. As theses files where pre-existing from a previous version of the package, it uses the--backup
flag to move any conflicting files with.new
suffix and puts back the original user files in its location.var
files located under.../target/_var
to.../target/../var
. Any conflicting file gets renamed to.new
and sync'ed to.../target/../var
ensuring to keep the original user configuration while providing fresh updated configuration examples.3. Migrate
SYNOPKG_PKGDEST/var
toSYNOPKG_SPKVAR
in all spk/*/src/service_setup.shAs identified in #4895 (comment) there are many
service_setup.sh
scripts still usingSYNOPKG_PKGDEST/var
which will necessarely break under DSM7. All of them are being migrated over to usingSYNOPKG_SPKVAR
Linked issues: #4545, #4758, #4895, #4910
Checklist
all-supported
completed successfullyAll packages cannot be tested, tested successfully:
tvheadend
ffmpeg
chromaprint
comskip
python38