-
-
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
Fix Tvheadend and ffmpeg for DMS 7 #4545
Conversation
On the dsm 6.x the version upgrade worked. (probably because the revision number is newer) |
14c5127
to
ce7d822
Compare
|
@publicarray I quickly went over this PR and at first glance things looked OK. I'll have another look at it over the week-end and from there might be able to propose experimental package on my github for the community to play with so we get some feedbacks. |
I would like to see this merged asap, as ejabberd depends on expat too (#4333). |
a87fb11
to
9490964
Compare
expat: use release archive SynoCommunity#4545 (comment)
9490964
to
8415fcf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a first review.
Still compiling in the background in the lookout for issues.
As for |
as #4539 is now on the master branch, you have to remove |
expat: use release archive SynoCommunity#4545 (comment)
0984d46
to
01fb395
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed a few variables needing adjusting in the code below in order to get closer to standard.
Perhaps a bit of it is out of scope of this PR...
But timing would be good I believe to go over them now.
Let me know what you think.
spk/tvheadend/src/service-setup.sh
Outdated
DVR_DIR=$(grep -e 'storage\":' ${file} | awk -F'"' '{print $4}') | ||
REAL_DIR=$(realpath "${DVR_DIR}") | ||
TRUNC_DIR=$(echo "${REAL_DIR}" | cut -c9-28) | ||
CHECK_VAR=$(echo "${REAL_DIR}" | cut -c29-32) | ||
# Replace any remaining target links in log files first | ||
sed -i -e "s,/var/packages/tvheadend/target,/usr/local/tvheadend,g" "${file}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here it would be better off using ${SYNOPKG_PKGDEST}
par of sed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sed
command will work in DSM7 but the path won't be available. Why is it needed anyway? Why can't the app do its thing in /var/packages/tvheadend
?
The /usr/local/{package}
folder is old DSM5 stuff and not supported on DSM7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I have no clue.
I guess this sed
could just be removed entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to find a sample in SYNOPKG_PKGVAR}/dvr/log
but I don't see any. I guess I need to have a receiver and start a recording.(which I don't have)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I do :)
Got the following on my DSM6:
root@th0ma7-nas:/var/packages/tvheadend/target/var/dvr# tree -d
.
├── autorec
├── config
└── log
3 directories
Honestly I've been wishing to rework all this for a year but never took the time to do so. The backup/recovery process does not work, period.
- For instance the
/var/packages/tvheadend/target/var/config
references to/usr/local/tvheadend
should besed
ed to/var/package/tvheadend
(clearly the "binary matches
" isn't good in the grep below):
# grep -R "/usr/local/tvheadend" *
Binary file bin/tvheadend matches
var/channel/config/65ab00d40fe4addffdf4babbc3b390d4: "icon": "file:https://usr/local/tvheadend/.xmltv/",
var/channel/config/f87d3e9167eceb6d6f13e9ab7739f0cb: "icon": "file:https://usr/local/tvheadend/.xmltv/",
var/channel/config/0cdf1b095014ab7990f9c8569a69270b: "icon": "file:https://usr/local/tvheadend/.xmltv/",
var/channel/config/1fbe2fe151b5c6d9f555a69ce61af02f: "icon": "file:https://usr/local/tvheadend/.xmltv/",
var/channel/config/3b1392ac0539b5b4a400b0d81d4e34eb: "icon": "file:https://usr/local/tvheadend/.xmltv/",
var/config: "chiconpath": "file:https://usr/local/tvheadend/.xmltv/",
var/config: "muxconfpath": "/usr/local/tvheadend/share/tvheadend/data/dvb-scan/",
- This entire directory (e.g.
/var/packages/tvheadend/target/var
) needs to be backup/restored along with creating a recoverysomething-config-backup-date.tar.bz
in order to recover as needed.
My personal backup script: https://raw.githubusercontent.com/th0ma7/synology/master/tvheadend-backup.sh - There is a caching directory
/var/packages/tvheadend/target/cache
that needs to be recovered as well. It would benefit from being located elsewhere under/volume1/...
from a user defined param at installation time.
# du -hs cache var
24M cache
14M var
- And also having a few scripts & configs that needs to be added manually that I should add to the default package...
BTW, just got my tvheadend
and ffmpeg
packages ready for DSM7... in theory ready for testing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@publicarray I found what the issue is...
Directories accesscontrol
and passwd
are now located under /var/packages/tvheadend/target/var -> /volume1/@appstore/tvheadend/var
) where the password/a927e30a755504f9784f23a4efac5109
looks like:
{
"enabled": true,
"username": "admin",
"password2": "@password@",
"wizard": true
}
Moving both directories (accesscontrol
and passwd
) to /var/packages/tvheadend/var -> /volume1/@appdata/tvheadend
) then manually fixing the password solved the isse:
mv /volume1/@appstore/tvheadend/var/* /volume1/@appdata/tvheadend/.
wizard_password=$(echo -n "TVHeadend-Hide-${wizard_password:=admin}" | openssl enc -a)
sed -i -e "s/@password@/${wizard_password}/g" /var/packages/tvheadend/var/a927e30a755504f9784f23a4efac5109
EDIT: Thus the issue lies either with the changes of ${SYNOPKG_PKGDEST}
vs ${SYNOPKG_PKGVAR}
... or how the tvheadend_extra_install
part of the Makefile
is being done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@publicarray reminder on this.
I've looked at compile options but can't see something obvious that allows moving around theses two directories...
I'll try to have another look at it later and see if I can come-up with a fix somehow.
--prefix=DIR$ Installation root [/usr/local]
--bindir=DIR Install binaries in DIR [${prefix}/bin]
--libdir=DIR Install libraries in DIR [${prefix}/lib]
--mandir=DIR Install man pages in DIR [${datadir}/man]
--datadir=DIR Install data files in DIR [${prefix}/share]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@publicarray and @hgy59 I believe I have found where the issue is.
And may have found a second one actually... or food for thought.
First issue:
It relates to $(STAGING_DIR)
where the entire content is being tgz
and ends-up being installed over to /var/packages/tvheadend/target/
(appstore). Although it happens that work-*/staging/var
containing both accesscontrol
and passwd
that should follow the $(SYNOPKG_PKGVAR) and end-up into /var/packages/tvheadend/var
(appdata) where all the automatically generated files also end-up going.
An idea to circumvent this:
- From the
Makefile
, install files understaging/appdata
using a new variable such as$(STAGING_SPKVAR)
. - installer script go over all files & directories in
staging/appdata
. Ifinstall
just copy to/var/packages/tvheadend/var
else perhaps something as trivial as arsync
no-overwrite over the directory (which could be used for all cases actually). Depending of DSM the destination folder is set fromSYNOPKG_PKGVAR
so it should always work.
Second issue: (not sure about this one)
I wonder if it would make sense to extend solution proposed for the first issue to add variables for $(STAGING_SPKHOME)
, $(STAGING_SPKETC)
and $(STAGING_SPKTEMP)
and use rsync
to copy files over the end-state location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or a simple work-around is to move the accesscontrol & passwd directory creation and file copying at the service-setup.sh level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hgy59 and @publicarray Got a working solution.
Will provide a separate PR to address this later today.
@th0ma7 If you want you can add #4551 to this PR*, so we can see green(er) ✔️ s (I initially thought that it was more difficult, so I did not even attempt it, shame on me :) but good work!) * just checkout this branch and add your commits (I use github's cli: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've included PR #4551 directly in this PR with hope to get all green flags.
Other than the ${SYNOPKG_PKGDEST}/var
vs ${SYNOPKG_PKGVAR}
variable below which I now have doubts, everything else looks great!
Nice team work!
@publicarray Awesome! There now only |
regarding But |
expat: use release archive SynoCommunity#4545 (comment)
@publicarray I'll be revisiting this PR over the next few days, starting with rebasing in order to get this merged asap considering the increasing noise over DSM7. @hgy59 and @ymartin59 would be great if you can find cycles to go over it and do another round of review to confirm all looks OK? |
expat: use release archive SynoCommunity#4545 (comment)
Based on feedbacks from previous maintainer remove unecessary code to manage faulty root directory recordings. Ref: SynoCommunity#4545 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now recall where we left...
Basically the PR was ready, besides this.
Issue is on DSM7: the following files gets installed in /var/packages/tvheadend/target/var
while all the tvheadend tree ends-up going under /var/package/tvheadend/var
.
As such, it doesn't work as the web server can't find the access
and passwd
files.
We need #4579 (or any other viable solution) to solve this.
fix ffmpeg (libaom) in newer gcc versions opencv/opencv#10032
pkgverify.cpp:225 Failed to load pkg info, version=[4.3.20201011~9ed76c0-26], correct-format=[^\d+(\.\d+){0,5}(-\d+)?$] pkgverify.cpp:278 Failed to verify package, spk=[/volume1/@tmp/upload_tmp.122880] result=[{"action":"prepare","beta":false,"betaIncoming":false,"error":{"code":261,"description":"invalid package info content"},"installReboot":false,"package":"tvheadend","packageName":"Tvheadend","stage":"prepare","success":false}]
Based on feedbacks from previous maintainer remove unecessary code to manage faulty root directory recordings. Ref: SynoCommunity#4545 (comment)
As this solves all build errors I recommend moving ahead and to merge it. @hgy59 and/or @ymartin59 are you ok with this PR? |
Motivation: cherry-picked commits from dsm7-packages branch and added fixes to uriparser and tvheadend version number
Linked issues: #4524
Checklist
all-supported
completed successfully