Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,421

    LMS on Alpine Linux

    > Excerpt from my Config.pm:

    What Config.pm would this be? This more looks like from a
    Slim::Utils::OS::* module (which I'd recommend you'd use, a Custom.pm).

    --

    Michael

  2. #12
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    991
    Quote Originally Posted by mherger View Post
    > Excerpt from my Config.pm:

    What Config.pm would this be? This more looks like from a
    Slim::Utils::OS::* module (which I'd recommend you'd use, a Custom.pm).
    You're right - it's from my Custom.pm (not sure where the Config.pm came from), and it was meant to be an example of "customize LMS for an unsupported OS platform" I linked to in #7
    Various SW: Web Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  3. #13
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    991
    Quote Originally Posted by sodface View Post
    In option 1, is there a symlink under CPAN/arch pointing to the compiled modules?
    In my case, it does (I keep all non-standard files (i.e. those not in the no-CPAN tar like arch, Custom.pm) in a separate directory in /opt, so I can just untar a new LMS version, and link the custom stuff). However, for a package, I'm not sure if this approach makes sense (since the package manager can take care of everything during the install process)
    Various SW: Web Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  4. #14
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,468
    Quote Originally Posted by sodface View Post
    @ralpy, thanks for the input. So are you recommending _not_ creating a package for LMS itself but maybe just the dependencies, like Perl and the openrc scripts? What about the modules?
    No. I was only trying to point out that lms can be kept within one folder.

    What I've seen from my limited exposure to Alpine packages are probably the right way to go.

    Perhaps multiple packages like back in the CSOS days.

    One for the server files, one for the CPAN modules that need to be compiled, and another for the vendor utilities like sox, flac, faad, etc.

    The logitechmediaserver srpm files are available here. Just to see the break down.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  5. #15
    Senior Member
    Join Date
    Jul 2008
    Posts
    118
    After getting derailed by seemingly random file checksum mismatches using the internal SATA port on the armel M300's I was working with, I finally basically gave up on that older hardware and picked up some newer x86_64 Wyse thin clients: a 5070 and several 3040's. These things are really nice.

    I can use off the shelf Alpine on them obviously so that's a big time saver. Still have to build and package squeezelite and LMS. Squeezelite is pretty straightforward and Ralphy has the APKBUILD for it on github.

    Had my plan mostly together for packaging up LMS and apparently Alpine doesn't agree that installing to /opt complies with the FHS. I got this error when building the package:
    Code:
    >>> lms*: Running postcheck for lms
    >>> ERROR: lms*: Packages must not put anything under /srv, /usr/local or /opt
    The relevant section of the script:

    Code:
    # checking for FHS compat                   
            if ! options_has "!fhs"; then
                    for i in "$dir"/srv/* "$dir"/usr/local/* "$dir"/opt/*; do
                            if [ -e "$i" ]; then
                                    error "Packages must not put anything under /srv, /usr/local or /opt"
                                    return 1
                            fi
                    done       
                    if [ -d "$dir"/usr/var ]; then
                            error "Found /usr/var, localstatedir is most likely wrong"
                            return 1
                    fi
            fi
    The Alpine packaging wiki reference has this for the !fhs option:

    Code:
    !fhs | Don't enforce checks on path that follow the FHS
    I guess I'm interpreting this correctly? That they are saying that installing to /opt isn't allowed by the FHS? The wording is a little clunky, something like "!fhs | allow paths to violate the FHS" or "!fhs | skip FHS compliancy checks" would be a little clearer.

    // after further reading, I think Alpine's position is that distribution provided packages shouldn't install to /opt. I can just use the !fhs option in the APKBUILD but it just feels wrong.
    Last edited by sodface; 2020-05-04 at 20:44.

  6. #16
    Senior Member
    Join Date
    Jul 2008
    Posts
    118
    Finally made some decisions and have LMS installed from custom Alpine packages on my new Dell/Wyse 5070. So far so good.

    I went with an /opt setup following the FHS, at least so far as I can decipher it. I ended up having four packages:

    lms
    lms-utils
    lms-modules
    lms-nocpan

    The lms package is sort of a meta-package that has all the dependency info for the package manager to pull in the other 3 lms-* packages and perl etc. It also creates the openrc init.d/conf.d scripts, creates an lms user and group, and creates a few folders and sets ownership and permissions. This is the only package you would install, so "sudo apk add lms" installs everything, then you just need to start it.

    lms-utils are the helper programs under /opt/lms/Bin (flaac, faad, etc.). lms-modules are the compiled CPAN modules from slimserver-vendor and lms-nocpan is just the repackaged tar.gz from the nightly download page.

    I guess my thinking is that I can just frequently update the lms-nocpan package separately and leave the other three alone mostly until a Perl upgrade or something forces a change. Comments welcome!

    Here's the Custom.pm I'm using which is also contained in the main lms package:

    Code:
    # This file contains a custom OS package to provide information on the
    # installation structure on Alpine.
    
    package Slim::Utils::OS::Custom;
    
    use strict;
    
    use base qw(Slim::Utils::OS::Linux);
    
    sub initDetails {
    	my $class = shift;
    
    	$class->{osDetails}->{os}     = 'Linux';
    	$class->{osDetails}->{osName} = 'Alpine Linux';
    
    	# Ensure we find manually installed plugin files.
    	push @INC, '/var/opt/lms';
    	push @INC, '/var/opt/lms/Plugins';
    
    	return $class->{osDetails};
    }
    
    =head2 dirsFor( $dir )
    
    Return OS Specific directories.
    
    Argument $dir is a string to indicate which of the Logitech Media Server
    directories we need information for.
    
    =cut
    
    sub dirsFor {
    	my ($class, $dir) = @_;
    
    	my @dirs = ();
    
    	# Overrides for specific directories.
    	if ($dir eq 'Plugins') {
    
    		# Look in the normal places.
    		push @dirs, $class->SUPER::dirsFor($dir);
    
    		# User-installed plugins are in a different place, so add it.
    		push @dirs, '/var/opt/lms/Plugins';
    
    	} elsif ($dir eq 'ClientPlaylists') {
    
    		# LMS would normally try to put client playlists in the prefs
    		# directory, but they aren't really prefs since they're dynamic
    		# state of the clients. Effectively, they're the same as the
    		# database cache, so we move these under /var/lib.
    		push @dirs, '/var/opt/lms/ClientPlaylists';
    
    	} elsif ($dir =~ /^(?:prefs)$/) {
    
    		# Server and plugin preferences are in a different place.
    		push @dirs, $::prefsdir || '/etc/opt/lms/prefs';
    
    	} elsif ($dir eq 'log') {
    
    		push @dirs, $::logdir || "/var/opt/lms/log";
    
    	} elsif ($dir eq 'cache') {
    
    		push @dirs, $::cachedir || "/var/opt/lms/cache";
    
    	} else {
    
    		# Use the default behaviour to locate the directory.
    		push @dirs, $class->SUPER::dirsFor($dir);
    
    	}
    
    	return wantarray() ? @dirs : $dirs[0];
    }
    
    sub ignoredItems {
    	return (
    		'bin'       => '/',
    		'boot'      => '/',
    		'dev'       => '/',
    		'etc'       => '/',
    		'lib'       => '/',
    		'opt'       => '/',
    		'proc'      => '/',
    		'root'      => '/',
    		'run'       => '/',
    		'sbin'      => '/',
    		'swap'      => '/',
    		'sys'       => '/',
    		'tmp'       => '/',
    		'usr'       => '/',	
    		'var'       => '/',
    		'lost+found'=> 1,
    	);
    }
    
    1;
    
    __END__

  7. #17
    Senior Member
    Join Date
    Jul 2008
    Posts
    118
    Updated lms-nocpan package to the latest nightly:

    Code:
    Logitech Media Server Version: 8.0.0 - 1588799628 @ Wed May 6 23:55:26 CEST 2020
    Installed the updated package:

    Code:
    server:~/aports/main/lms-nocpan$ sudo apk upgrade lms-nocpan
    (1/1) Upgrading lms-nocpan (8.0-r0 -> 8.0-r1)
    OK: 1111 MiB in 221 packages
    server:~/aports/main/lms-nocpan$ sudo rc-service lms restart
     * Stopping Logitech Media Server ...                                                                                                      [ ok ]
     * Starting Logitech Media Server ...                                                                                                      [ ok ]
    Worked like a champ!

    //edit that apk upgrade command above is actually incorrect. It did work, but the upgrade command updates all installed packages (the lms-nocpan in the command above was really just ignored) it just so happened that the only package needing upgrading was lms-nocpan.
    Last edited by sodface; 2020-05-15 at 21:07.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •