diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml index 2f72d1c9d4..0aecd7a8e0 100644 --- a/.github/actions/build/action.yaml +++ b/.github/actions/build/action.yaml @@ -40,6 +40,13 @@ runs: ref: ${{ steps.getversion.outputs.GIT_BRANCH }} + - name: Check out pCP platform code + if: ${{ startsWith(inputs.build-params, 'pcp') }} + uses: actions/checkout@v4 + with: + repository: picoreplayer/lms-update-script + path: platforms/pcp + - name: Set up Docker environment if: ${{ startsWith(inputs.build-params, 'docker') }} id: dockersetup diff --git a/Changelog9.html b/Changelog9.html index 42809b6eb9..1267af28c8 100644 --- a/Changelog9.html +++ b/Changelog9.html @@ -17,6 +17,7 @@

Version 9.0.4


diff --git a/HTML/EN/html/docs/linux-update.html b/HTML/EN/html/docs/linux-update.html index 54b7f17f6c..2cc2eb7e4e 100644 --- a/HTML/EN/html/docs/linux-update.html +++ b/HTML/EN/html/docs/linux-update.html @@ -1,9 +1,25 @@ -[% extension = installerFile.match('\.(rpm|deb)$'); +[% extension = installerFile.match('\.(rpm|deb|tcz)$'); IF extension; distro = extension.0; END; %] +[% IF distro == 'tcz' %] + +

On piCorePlayer we provide a script to download and update Lyrion Music Server. + This script will update your local copy of LMS to the latest build.

+ + + +

...or use + to update LMS using the piCorePlayer interface.

+ +[% ELSE %] +

On some Linux distributions we provide an automatic download of Lyrion Music Server update installers. These currently are available for .rpm and .deb based systems.

@@ -25,3 +41,5 @@

  • sudo dpkg -i [% installerFile %]
  • [% END %] + +[% END %] diff --git a/HTML/EN/html/docs/linux-update.html.de b/HTML/EN/html/docs/linux-update.html.de index 59113b4792..94520dab86 100644 --- a/HTML/EN/html/docs/linux-update.html.de +++ b/HTML/EN/html/docs/linux-update.html.de @@ -1,9 +1,25 @@ -[% extension = installerFile.match('\.(rpm|deb)$'); +[% extension = installerFile.match('\.(rpm|deb|tcz)$'); IF extension; distro = extension.0; END; %] +[% IF distro == 'tcz' %] + +

    piCorePlayer stellt ein Skript zum Herunterladen und Aktualisieren von Lyrion Music Server zur Verfügung. + Dieses Skript aktualisiert Ihr LMS auf den neuesten Stand.

    + + + +

    ...oder folgen Sie + zur Aktualisierung des LMS über die piCorePlayer-Schnittstelle.

    + +[% ELSE %] +

    Auf einigen Linux Distributionen bieten wir eine vereinfachte Lyrion Music Server Aktualisierung an. Dies ist derzeit auf RPM und Debian basierenden Systemen der Fall.

    @@ -25,3 +41,5 @@ Dies ist derzeit auf RPM und Debian basierenden Systemen der Fall.

  • sudo dpkg -i [% installerFile %]
  • [% END %] + +[% END %] diff --git a/HTML/EN/html/docs/linux-update.html.fr b/HTML/EN/html/docs/linux-update.html.fr index bb431144a1..8088f8588b 100644 --- a/HTML/EN/html/docs/linux-update.html.fr +++ b/HTML/EN/html/docs/linux-update.html.fr @@ -1,9 +1,25 @@ -[% extension = installerFile.match('\.(rpm|deb)$'); +[% extension = installerFile.match('\.(rpm|deb|tcz)$'); IF extension; distro = extension.0; END; %] +[% IF distro == 'tcz' %] + +

    Sur piCorePlayer, nous fournissons un script pour télécharger et mettre à jour Lyrion Music Server. + Ce script mettra à jour votre copie de LMS avec la dernière version.

    + + + +

    ...ou bien suivez + pour mettre à jour le LMS en utilisant l'interface piCorePlayer.

    + +[% ELSE %] +

    Sur certaines distributions Linux, nous proposons un téléchargement automatique des programmes d'installation des mises à jour de Lyrion Music Server. Ceux-ci sont actuellement disponibles pour les systèmes basés sur des packages .rpm et .deb.

    [% IF distro == 'deb' %] @@ -24,3 +40,5 @@ END;

  • sudo dpkg -i [% installerFile %]
  • [% END %] + +[% END %] diff --git a/Slim/Utils/OS/Linux.pm b/Slim/Utils/OS/Linux.pm index db36106be9..9242a076b0 100644 --- a/Slim/Utils/OS/Linux.pm +++ b/Slim/Utils/OS/Linux.pm @@ -76,7 +76,7 @@ sub getFlavor { # parse new-school operating system identification file if available if (-f '/etc/os-release' && open(OS_RELEASE, '/etc/os-release')) { while () { - if (/^NAME="(.*?)"/i) { + if (/^NAME="?(.*)"?/i) { $osName = lc($1); last; } @@ -104,6 +104,11 @@ sub getFlavor { } elsif (-f '/etc/synoinfo.conf' || -f '/etc.defaults/synoinfo.conf') { return 'Synology DiskStation'; + + } elsif ($osName =~ /picoreplayer/ ) { + + return 'piCorePlayer'; + } return 'Linux'; diff --git a/Slim/Utils/OS/pCP.pm b/Slim/Utils/OS/pCP.pm new file mode 100644 index 0000000000..a4f3653c99 --- /dev/null +++ b/Slim/Utils/OS/pCP.pm @@ -0,0 +1,118 @@ +package Slim::Utils::OS::pCP; + +# OS file for pCP https://www.picoreplayer.org +# +# Revision 1.1 +# 2017-04-16 Removed /proc from a music path +# +# Revision 1.2 +# 2017-08-14 Added Manual Plugin directory at Cache/Plugins +# +# Revision 2.0 +# 2025-03-23 Packages now being built by Lyrion.org. Use default Cache/updates folder + +use strict; +use warnings; + +use base qw(Slim::Utils::OS::Linux); +use File::Spec::Functions qw(catdir); + +use constant MAX_LOGSIZE => 1024*1024*1; # maximum log size: 1 MB +use constant UPDATE_DIR => '/tmp/slimupdate'; + +sub initDetails { + my $class = shift; + + $class->{osDetails} = $class->SUPER::initDetails(); + $class->{osDetails}->{osName} = 'piCore'; + return $class->{osDetails}; +} + +sub getSystemLanguage { 'EN' } + +sub localeDetails { + my $lc_ctype = 'utf8'; + my $lc_time = 'C'; + + return ($lc_ctype, $lc_time); +} + +=head2 dirsFor( $dir ) + +Return OS Specific directories. + +Argument $dir is a string to indicate which of the server directories we +need information for. + +pCP Uses a update directory in /tmp and a custom manual plugin folder + +=cut + +sub dirsFor { + my ($class, $dir) = @_; + + my @dirs; + + if ($dir eq 'updates') { + + mkdir UPDATE_DIR unless -d UPDATE_DIR; + @dirs = (UPDATE_DIR); + } + else { + @dirs = $class->SUPER::dirsFor($dir); + + if ($dir eq "Plugins") { + push @dirs, catdir( Slim::Utils::Prefs::preferences('server')->get('cachedir'), 'Plugins' ); + unshift @INC, catdir( Slim::Utils::Prefs::preferences('server')->get('cachedir') ); + } + } + + return wantarray() ? @dirs : $dirs[0]; +} + +sub canAutoUpdate { 1 } +sub installerExtension { 'tcz' } +sub installerOS { 'pcp' } + +sub getUpdateParams { + my ($class, $url) = @_; + + if ($url) { + require File::Slurp; + + my $updateFile = UPDATE_DIR . '/update_url'; + File::Slurp::write_file($updateFile, $url); + } + + return { + cb => \&Slim::Utils::OS::Linux::signalUpdateReady + }; +} + +sub logRotate { + # only keep small log files (1MB) because they are in RAM + Slim::Utils::OS->logRotate($_[1], MAX_LOGSIZE); +} + +sub ignoredItems { + return ( + 'bin' => '/', + 'dev' => '/', + 'etc' => '/', + 'opt' => '/', + 'init' => '/', + 'root' => '/', + 'sbin' => '/', + 'tmp' => '/', + 'var' => '/', + 'lib' => '/', + 'run' => '/', + 'sys' => '/', + 'usr' => '/', + 'proc' => '/', + 'lost+found'=> 1, + ); +} + +1; + diff --git a/Slim/Utils/OSDetect.pm b/Slim/Utils/OSDetect.pm index dacbe64fc5..512024c3ee 100644 --- a/Slim/Utils/OSDetect.pm +++ b/Slim/Utils/OSDetect.pm @@ -111,6 +111,11 @@ sub init { require Slim::Utils::OS::Synology; $os = Slim::Utils::OS::Synology->new(); + } elsif ($os =~ /piCorePlayer/i) { + + require Slim::Utils::OS::pCP; + $os = Slim::Utils::OS::pCP->new(); + } else { $os = Slim::Utils::OS::Linux->new(); diff --git a/Slim/Utils/Update.pm b/Slim/Utils/Update.pm index 7516908adc..592ea9a3b3 100644 --- a/Slim/Utils/Update.pm +++ b/Slim/Utils/Update.pm @@ -341,7 +341,7 @@ sub cleanup { my $ext = $os->installerExtension() . ($additionalExt ? "\.$additionalExt" : ''); - Slim::Utils::Misc::deleteFiles($path, qr/^LyrionMusicServer.*\.$ext$/i); + Slim::Utils::Misc::deleteFiles($path, qr/^LyrionMusicServer.*\.$ext(\.md5\.txt)?$/i); } 1; \ No newline at end of file