Upgrade x (Solaris + SqueezeCenter)

Here’s a quick way to upgrade one or both Solaris (tested with Nevada snv_107) and SqueezeCenter (tested with SC 7.4 24827).

  1. Remove the CPAN directory in the SC root directory
    # mv CPAN CPAN.orig
  2. Install missing CPAN modules
    # perl -MCPAN -e shell
    cpan> install Bundle::CPAN
    . . .
    cpan> reload CPAN
    cpan> install I18N::LangTags
    cpan> force install Scalar::Util
  3. Disable Encode::Detect::Detector module in Slim/Utils/Unicode.pm (line 40). The module can’t be compiled for Solaris.
    # vi Slim/Utils/Unicode.pm
    . . .
    #use Encode::Detect::Detector;

SqueezeCenter again. Testing v7.3

SqueezeCenter 7.2 is officially out and not interesting anymore πŸ˜‰ Let’s have a look at version 7.3 which has a new streaming service. In this test I downloaded SqueezeCenter-7.3-22975.ZIP from here.

The first attempt to start the server (after unpacking and “chmod“-ding) gave me this error:

# ./slimserver.pl
The following modules failed to load: YAML::Syck

To download and compile them, please run: /usr/local/SqueezeCenter-7.3-22975/Bin/build-perl-modules.pl YAML::Syck

Exiting..

The “built-in” build-perl-modules.pl failed to install the CPAN module:

# /usr/local/SqueezeCenter-7.3-22975/Bin/build-perl-modules.pl YAML::Syck
Welcome to the Slim Devices perl module installer.

These packages are needed for SqueezeCenter to function.
You will need a C compiler (gcc), make, and perl installed.

You will need development libraries for MySQL. eg: libmysqlclient

You will need development libraries for expat. eg: libexpat1-dev

*** Ignore any warnings about AppConfig. ***

Please enter a perl binary to use (defaults to /usr/bin/perl)
This must be the same perl binary that you ran this program with –>
Please enter a directory to download files to –>
Downloads will use lwp to fetch tarballs.

Downloading YAML-Syck-0.64.tar.gz to: /usr/local/SqueezeCenter-7.3-22975
Something looks wrong – I couldn’t read /usr/local/SqueezeCenter-7.3-22975/YAML-Syck-0.64.tar.gz, which I just downloaded.
Uncompressing..
sh: YAML-Syck-0.64.tar.gz: cannot open
tar: blocksize = 0
Couldn’t change to YAML-Syck-0.64 : No such file or directory at /usr/local/SqueezeCenter-7.3-22975/Bin/build-perl-modules.pl line 226, line 2.

So, I decided to go the old way and get rid of the supplied with SqueezeCenter CPAN directory.

# mv CPAN CPAN-orig

… update YAML::Syck just in case…

# perl -MCPAN -e shell
. . .
cpan[1]> install YAML::Syck
YAML::Syck is up to date (1.05).
#

… and start the server again …

# ./slimserver.pl
Can’t locate Encode/Detect/Detector.pm in @INC (@INC contains: /usr/local/SqueezeCenter-7.3-22975/CPAN/arch/5.8/i86pc-solaris-64int /opt/csw/SqueezeCenter-7.3-22975/CPAN/arch/5.8/i86pc-solaris-64int/auto /usr/local/SqueezeCenter-7.3-22975/CPAN/arch/5.8.4/i86pc-solaris-64int /usr/local/SqueezeCenter-7.3-22975/CPAN/arch/5.8.4/i86pc-solaris-64int/auto /usr/local/SqueezeCenter-7.3-22975/CPAN/arch/5.8/i86pc-solaris-64int /usr/local/SqueezeCenter-7.3-22975/CPAN/arch/5.8/i86pc-solaris-64int/auto /usr/local/SqueezeCenter-7.3-22975/CPAN/arch/i86pc-solaris-64int /usr/local/SqueezeCenter-7.3-22975/lib /usr/local/SqueezeCenter-7.3-22975/CPAN /usr/local/SqueezeCenter-7.3-22975 /usr/local/SqueezeCenter-7.3-22975 /usr/perl5/5.8.4/lib/i86pc-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at /usr/local/SqueezeCenter-7.3-22975/Slim/Utils/Unicode.pm line 40.
BEGIN failed–compilation aborted at /usr/local/SqueezeCenter-7.3-22975/Slim/Utils/Unicode.pm line 40.
Compilation failed in require at /usr/local/SqueezeCenter-7.3-22975/Slim/Utils/Prefs/Namespace.pm line 30.
BEGIN failed–compilation aborted at /usr/local/SqueezeCenter-7.3-22975/Slim/Utils/Prefs/Namespace.pm line 30.
Compilation failed in require at /usr/local/SqueezeCenter-7.3-22975/Slim/Utils/Prefs.pm line 81.
BEGIN failed–compilation aborted at /usr/local/SqueezeCenter-7.3-22975/Slim/Utils/Prefs.pm line 81.
Compilation failed in require at /usr/local/slimserver/slimserver.pl line 146.
BEGIN failed–compilation aborted at /usr/local/slimserver/slimserver.pl line 146.

This error looks familiar. And after commenting line 40 in SqueezeCenter-7.3-22975/Slim/Utils/Unicode.pm (#use Encode::Detect::Detector; ) the server came alive and immediately updated the firmware of the Transporter to version 62.

SqueezeCenter and Scalar::Util

After upgrading to snv_93 SqueezeCenter (quite predictably) refused to start again. The error was:

# ./slimrun
Weak references are not implemented in the version of perl at /usr/perl5/site_perl/5.8.4/DBIx/Class/Schema.pm line 8
BEGIN failed–compilation aborted at /usr/perl5/site_perl/5.8.4/DBIx/Class/Schema.pm line 8.
Compilation failed in require at (eval 113) line 3.
…propagated at /usr/perl5/5.8.4/lib/base.pm line 85.
BEGIN failed–compilation aborted at /opt/csw/squeezecenter-7.2-21059-noCPAN/Slim/Schema.pm line 29.
Compilation failed in require at /opt/csw/squeezecenter-7.2-21059-noCPAN/Slim/Utils/Progress.pm line 11.
BEGIN failed–compilation aborted at /opt/csw/squeezecenter-7.2-21059-noCPAN/Slim/Utils/Progress.pm line 11.
Compilation failed in require at /opt/csw/squeezecenter-7.2-21059-noCPAN/Slim/Utils/Scanner.pm line 45.
. . .

The issue is related to the same Scalar::Util module. Just force install it like explained here.

SqueezeCenter and Compress::Zlib

After upgrading to Nevada b92 SqueezeCenter refused to start with the following error:

The following modules failed to load: Compress::Zlib

# perl -MCPAN -e shell
cpan> install Compress::Zlib
. . .
Module [Compress::Zlib] failed to load: is only available with the XS version
. . .

But the actual problem is Scalar::Util. To solve the problem reinstall Scalar::Util and then Compress::Zlib. Use forceΒ install if CPAN says that the latest version is already installed:

# perl -MCPAN -e shell
. . .
cpan[1]> install Scalar::Util
CPAN: Storable loaded ok (v2.12)
Going to read /var/tmp/cpan/Metadata
Database was generated on Tue, 24 Jun 2008 10:02:57 GMT
Scalar::Util is up to date (1.19).
cpan[2]> force install Scalar::Util
. . .
cpan[3]> force install Compress::Zlib
. . .

Sources: whirlpool.net.au and Usenet forums.

SqueezeCenter 7.1 under Solaris

The idea was to use “bare” SqueezeCenter without bundled CPAN (the CPAN directory was moved away) modules, Solaris 11 (or Nevada build 88) and supplied with Solaris PERL and MySQL.

Then if you start slimserver.pl the errors will let you know which CPAN modules to install. For example:

The following modules failed to load: version JSON::XS YAML::Syck GD
. . .
Can’t locate JSON::XS.pm in @INC (@INC contains: squeezecenter-7.1-19407-noCPAN/CPAN/arch/5.8/i86pc-solaris-64int

Or For Nevada b95:

The following CPAN modules were found but cannot work with SqueezeCenter:
File::Temp (loaded 0.14, need 0.17)
I18N::LangTags (loaded 0.29, need 0.35)

To fix this problem you have several options:
1. Install the latest version of the module(s) using CPAN: sudo cpan Some::Module
2. Update the module’s package using apt-get, yum, etc.
3. Run the .tar.gz version of SqueezeCenter which includes all required CPAN modules.

Usually, the bundled CPAN is not up to date. So, let’s install it first:

# perl -MCPAN -e shell
cpan[1]> install Bundle::CPAN
. . .
cpan[2]> quit

To install (or upgrade) a module run the following:

# perl -MCPAN -e shell
cpan[1]> install JSON::XS

The only exception is Encode/Detect/Detector.pm or Encode::Detect::Detector. It’s has not being touched by the developer for many years and is not recommended for use. The module can be compiled with c++ or g++ (instead of used by default cc or gcc), but with a lot of pain and manual intervention. The easiest way is to get rid of it completely:

  • Remove Encode::Detect::Detector from modules.conf (in the root directory of SqueezeCenter)
  • Remove or comment the following line in Slim/Utils/Unicode.pm:
    use Encode::Detect::Detector;