Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Changelog9.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ <h2><a name="v9.0.4" id="v9.0.4"></a>Version 9.0.4</h2>
<ul>
<li>Add Homebrew's binary path to OSX search paths.</li>
<li><a href="https://github.com/LMS-Community/slimserver/issues/1441">#1441</a> - Install procps package Docker image in support of plugins which need the tools to manage their helper processes.</li>
<li>Make piCorePlayer a first class citizan: add Slim::Utils::OS::pCP to support it</li>
</ul>
<br />

Expand Down
20 changes: 19 additions & 1 deletion HTML/EN/html/docs/linux-update.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
[% extension = installerFile.match('\.(rpm|deb)$');
[% extension = installerFile.match('\.(rpm|deb|tcz)$');
IF extension;
distro = extension.0;
END;
%]

[% IF distro == 'tcz' %]

<p>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.<p>

<button onclick="window.location.href='http://' + window.location.hostname + ':80/cgi-bin/writetolms.cgi?ACTION=Update';">
Update &amp; restart Lyrion Music Server
</button>

<p>...or use
<script language="JavaScript">
document.write('<a href="' + window.location.protocol + '//' + window.location.hostname + ':80' + '/cgi-bin/lms-update.cgi?ACTION=Nightly' + '" >this Link</a> ' );
</script> to update LMS using the piCorePlayer interface.</p>

[% ELSE %]

<p>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.<p>

Expand All @@ -25,3 +41,5 @@
<li><code>sudo dpkg -i [% installerFile %]</code></li>
[% END %]
</ul>

[% END %]
20 changes: 19 additions & 1 deletion HTML/EN/html/docs/linux-update.html.de
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
[% extension = installerFile.match('\.(rpm|deb)$');
[% extension = installerFile.match('\.(rpm|deb|tcz)$');
IF extension;
distro = extension.0;
END;
%]

[% IF distro == 'tcz' %]

<p>piCorePlayer stellt ein Skript zum Herunterladen und Aktualisieren von Lyrion Music Server zur Verf&uuml;gung.
Dieses Skript aktualisiert Ihr LMS auf den neuesten Stand.<p>

<button onclick="window.location.href='http://' + window.location.hostname + ':80/cgi-bin/writetolms.cgi?ACTION=Update';">
Lyrion Music Server aktualisieren und neu starten
</button>

<p>...oder folgen Sie
<script language="JavaScript">
document.write('<a href="' + window.location.protocol + '//' + window.location.hostname + ':80' + '/cgi-bin/lms-update.cgi?ACTION=Nightly' + '" >diesem Link</a> ' );
</script> zur Aktualisierung des LMS &uuml;ber die piCorePlayer-Schnittstelle.</p>

[% ELSE %]

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

Expand All @@ -25,3 +41,5 @@ Dies ist derzeit auf RPM und Debian basierenden Systemen der Fall.<p>
<li><code>sudo dpkg -i [% installerFile %]</code></li>
[% END %]
</ul>

[% END %]
20 changes: 19 additions & 1 deletion HTML/EN/html/docs/linux-update.html.fr
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
[% extension = installerFile.match('\.(rpm|deb)$');
[% extension = installerFile.match('\.(rpm|deb|tcz)$');
IF extension;
distro = extension.0;
END;
%]

[% IF distro == 'tcz' %]

<p>Sur piCorePlayer, nous fournissons un script pour t&eacute;l&eacute;charger et mettre &agrave; jour Lyrion Music Server.
Ce script mettra &agrave; jour votre copie de LMS avec la derni&egrave;re version.<p>

<button onclick="window.location.href='http://' + window.location.hostname + ':80/cgi-bin/writetolms.cgi?ACTION=Update';">
Mise &agrave; jour et red&eacute;marrage de Lyrion Music Server
</button>

<p>...ou bien suivez
<script language="JavaScript">
document.write('<a href="' + window.location.protocol + '//' + window.location.hostname + ':80' + '/cgi-bin/lms-update.cgi?ACTION=Nightly' + '" >ce lien</a> ' );
</script> pour mettre &agrave; jour le LMS en utilisant l'interface piCorePlayer.</p>

[% ELSE %]

<p>Sur certaines distributions Linux, nous proposons un t&eacute;l&eacute;chargement automatique des programmes d'installation des mises &agrave; jour de Lyrion Music Server. Ceux-ci sont actuellement disponibles pour les syst&egrave;mes bas&eacute;s sur des packages .rpm et .deb.<p>

[% IF distro == 'deb' %]
Expand All @@ -24,3 +40,5 @@ END;
<li><code>sudo dpkg -i [% installerFile %]</code></li>
[% END %]
</ul>

[% END %]
7 changes: 6 additions & 1 deletion Slim/Utils/OS/Linux.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<OS_RELEASE>) {
if (/^NAME="(.*?)"/i) {
if (/^NAME="?(.*)"?/i) {
$osName = lc($1);
last;
}
Expand Down Expand Up @@ -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';
Expand Down
118 changes: 118 additions & 0 deletions Slim/Utils/OS/pCP.pm
Original file line number Diff line number Diff line change
@@ -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;

5 changes: 5 additions & 0 deletions Slim/Utils/OSDetect.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Slim/Utils/Update.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;