My thoughts on Slackware, life and everything

Month: February 2012 (Page 1 of 2)

OpenJDK 7 update 3 available for Slackware 13.37

 The JDK and JRE packages in Slackware are severely outdated. In case you are not familiar with them, “JDK” is the Java Development Kit and “JRE” is the Java Runtime Engine. As stated in a previous post on this blog, Slackware (and with it all the other distros) is no longer allowed to distribute Java packages based on the official binaries released by Oracle. You as an end-user are still allowed to download and use those binaries; you are just not allowed to re-distribute them.

You can do two things: grab Oracle’s binary tarballs, and use the jdk.SlackBuild and jre.SlackBuild scripts of Slackware to create updated packages with which you can upgrade an existing Java on your computers. Or you grab the source code of OpenJDK and build your own re-distributable packages. This second option is hopefully what Slackware will pick for its future releases.

In the meantime, I produced packages for slackware-current back in January 2012, compiled from these OpenJDK sources with the use of the icedtea build harness. That was a first, and successful, attempt at creating new JDK and JRE that could be used in Slackware. I was targeting slackware-current in the hope that Pat Volkerding would use the SlackBuild scripts as-is. Unfortunately, Slackware’s development has stalled a bit, and the ChangeLog.txt has not seen Java updates yet.

So, when I noticed that there was a new release of IcedTea which would produce very up-to-date OpenJDK binaries, I decided to build this on Slackware 13.37 instead of slackware-current and add the resulting packages to my regular repository. This allows everyone who is running Slackware version 13.37 or -current to enjoy the new JDK and web plugin.

Pre-built packages:

Packages and sources can be found in the usual locations. There are more mirrors than I mention here of course. Note that you need a JDK or JRE package (based on your needs), the rhino package (which is the JavaScript engine) and optionally icedtea-web (the Java browser plugin):

Compiling:

I built these packages twice: the first time I “bootstrapped” using the gcc-java compiler. The second time, I had installed my fresh openjdk package and built a new copy against itself. The value of the “BOOTSTRAP” variable in the script determines the type of build. You can not build OpenJDK with the Oracle JDK.

If you want to do this compilation yourself, then follow the README.txt carefully! You will additionally need to install apache-ant, xalan and xerces packages, all of which you will find in my package repository. If you are not on slackware-current then you will have to make some small modifications to the installed gcc and seamonkey packages. When following directions in the README.txt this is a trivial task.

Web plugin:

You can check if your web plugin has been installed and is working correctly, by visiting this URL: http://java.com/en/download/installed.jsp?detect=jre&try=1 .

After I finished building my packages I visited the above URL and it looked OK. Then I loaded a java applet on another page (http://chemagic.com/web_molecules/) and it crashed so hard that it took the browser down along with it. Wtf???

I had originally used version 1.1.4 of the icedtea-web sources (since that used to work before) but it turns out that there was a change in Mozilla Firefox since version 10.0. The change uncovers a bug which makes the plugin crash with the error message “Assertion failure: rt->onOwnerThread(), at /tmp/mozilla-release/js/src/jsapi.cpp“. I tracked down the bug reports, https://bugzilla.mozilla.org/show_bug.cgi?id=704249 and http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=820, and eventually found a working patch on the mailing list. This patch could only be applied against the latest source code for icedtea-web, which is why you will find an icedtea-web package with version “20120225” in my repository.

Good luck! Eric

 

Adding Linux to the Windows7 boot menu

When I create a Windows / Linux dual-boot computer I usually add Windows as an option to my LILO boot menu. That is the easiest way, and works always.

However, I ran into a situation where I could not use LILO as the primary boot loader and I had to look into the Windows7 “boot configuration data” or BCD. Actually it was Windows Vista, not Windows7, which was the first to abandon good old C:\boot.ini and start writing its bootloader configuration into a binary block of data. I wrote this post just to have this procedure available as a reference.

Windows7 contains the command-line program BCDedit which you are supposed to use for editing your Windows boot menu. A total load of crock it is. It will not support any OS that does not boot from the same hard disk that Windows7 is installed to… so I had some issues getting my Slackware added to the Windows boot menu because I had installed it on a second hard disk.

In the end I decided to shrink the Windows partition a little bit and add a small Linux partition where I could install LILO.

Microsoft has added a basic partition manager to Windows7 – something they do more often. If a 3rd party creates an invaluable add-on to provide functionality Microsoft did not include into Windows, then Microsoft will eventually copy its basic functionality into a half-hearted clone. Anyway, the freed-up hard disk space was allocated to a small partition which became Slackware’s “/boot” and I installed LILO to that /boot partition.

Then, just like in the days of Windows NT and “c:\boot.ini”, I extracted the first 512 bytes from the root sector of that /boot partition (in my case, that partition was “/dev/sda3“) and wrote it to a USB stick which I had mounted on “/mnt/hd“:

dd if=/dev/sda3 of=/mnt/hd/linux.bin bs=512 count=1

Rebooted to Windows7 and transfered that 512 byte file called “linux.bin” from the USB stick to the root of the Windows C: drive.

Next, I used BCDedit to add an entry to Windows7’s BCD store. Note that administrative privileges are required to use BCDedit!. What you do is navigate to “Start->All Programs->Accessories“, Right-click on “Command Prompt” and select “Run as administrator“.

In this command window, enter the BCDedit commands. Start by creating an entry for Slackware Linux. I use “Linux” as the label for the boot menu. The actual label you choose is arbitrary of course:

bcdedit /create /d “Linux” /application BOOTSECTOR

BCDedit will return an alphanumeric identifier for this entry. Copy that string into a text file and do not lose it!

In the remainder of this article I will refer to this string as {ID}. You would replace {ID} with the actual identifier as returned by the command you ran. An example of what you can get for an {ID} is {244ebca6-432f-11df-ab86-ce0c22f636af}.

The next step will be to specify which partition holds the copy of the Linux boot loader sector (our “linux.bin” file):

bcdedit /set {ID} device partition=c:

Then specify the actual path to the “linux.bin” file on that C: drive:

bcdedit /set {ID}  path \linux.bin

The Windows boot menu needs an entry for our Slackware Linux OS:

bcdedit /displayorder {ID} /addlast

Usually you won’t see the boot menu at all (after all, it does not contain any other entry than Windows7 itself). In order to allow the user of the computer some reflection time, we add a delay to the menu’s display timeout. Say, the boot menu should remain visible for 30 seconds before booting into the default selection:

bcdedit /timeout 30

That would be all. You can test the new Windows boot menu by rebooting the computer. You should be able to select either Windows7 (default) or Linux to boot into. When you choose “Linux”, you’ll be taken to Slackware’s familiar LILO menu.

If at any time you would have to remove the “Linux” menu option, you can run the following command … provided you wrote the {ID} string down somewhere:

bcdedit /delete {ID}

Have fun, even with Windows,

Eric

Speeding up my vlc.SlackBuild script

In a comment to my previous post about the VLC media player where I announced packages for VLC 2.0.0, Nille asked if I could explain a bit more about the SlackBuild script I use to create these packages.

In my scripts, I sometimes hide interesting side-tracks or shortcuts which you would not notice if you just run the script and wait patiently until the packages have been created.

The VLC SlackBuild script is huge. Apart from VLC sources, it also compiles over 50 (fifty!) other libraries and embeds them into the VLC package. This makes VLC such a versatile media player – it supports many media formats and input sources, has audio visualisation inputs and other cool stuff.

The penalty for having such a big script, is that compiling it all takes quite a bit of time. And if you just want to update VLC to a newer snapshot, it is aggravating when the script also recompiles all of the other internal dependencies. Furthermore, in order to compile the browser plugin, the script needs Mozilla’s xulrunner libraries. Since Slackware does not ship those, the xulrunner SDK has to be compiled as well and that is time-consuming- only to be thrown away after the compilation has ended.

I added a few pieces of code which allow me to considerably shorten the compilation time of my VLC packages.

  1. Allow the use of a tarball containing a pre-built xulrunner SDK
  2. Allow the use of a tarball containing prebuilt “contribs”, i.e. all the internal libraries VLC depends on

Let me explain both.

Pre-compiled mozilla SDK.

If you run the vlc.SlackBuild, and enable the creation of the browser plugin “npapi-vlc” (this is enabled by default in the script) then the SlackBuild script will first compile the xulrunner SDK. This takes a long, long time. So, in order to speed things up, the script will look for a pre-compiled version of the xulrunner SDK in the directory containing “vlc.SlackBuild” and use that instead if available. You can find this SDK tarball after the xulrunner compilation has ended; check the “./dist/sdk” subdirectory in the xulrunner source directory (normally that would be something like “/tmp/build/tmp-vlc/mozilla-<someversion>/dist/sdk/“) and copy the file “xulrunner-*.sdk.tar.bz2” you’ll find there back into the directory containing vlc.SlackBuild. Next time you run vlc.SlackBuild, it will extract and use the contents of that SDK file instead of compiling the SDK all over again. Big timesaver!

Pre-compiled contribs.

I usually update the internal libraries (the VLC developers call them the “contribs”) only when there is a reason. For instance, when VLC requires a newer version of such a library, or because a newer version brings speed improvements (think of ffmpeg). But inbetween minor releases of VLC I usually leave the contribs as they are, and only compile the new VLC sources. In order to save time, the vlc.SlackBuild has a commandline switch which tells it to only build the contribs, but skip the VLC sources. This switch is “–wrapvlcdeps”. If you run the command:

./vlc.SlackBuild –wrapvlcdeps

… then the script will compile all internal libraries, and then “wrap” the compiled contribs into a single tarball in your $OUTPUT directory (which is /tmp by default) with the name “vlc-vlcdeps-$ARCH.tar.bz2“. Here, “$ARCH” is the architecture for which you are compiling (usually i486 or x86_64). Note that this command will not create an actual VLC package! All it does is compile the internal dependencies and wrap those into a tarball for later use.

Now, if you copy that tarball back into the directory which contains vlc.SlackBuild, the script will be able to use its pre-compiled binary contents when it is time to create a VLC package. When you run the following command:

./vlc.SlackBuild –unwrapvlcdeps

… then the script will “unwrap” the contents of the “vlc-vlcdeps” tarball and won’t bother with compiling all those contribs again. Instead, the script will proceed with compiling the VLC sources and creating the final package. Big timesaver!

Note:

You may be aware that I need to compile two versions of VLC for my repositories, thanks to stupid US software patents (Europeans, do not forget to sign the anti-ACTA petition at https://secure.avaaz.org/en/eu_save_the_internet_spread/ !). One version contains code which would violate the US software patents, such as mp3 and aac audio encoders, while the other version is free of software patent issues and therefore free to distribute inside the US. The vlc.SlackBuild script can distinguish between “restricted” and “unrestricted” tarballs containing the “contribs” or vlcdeps as I call them myself. The script has this piece of code:

  if [ "${USE_PATENTS}" == "YES" ]; then
    DEPSFILE="$SRCDIR/$PRGNAM-vlcdeps_restricted-$ARCH.tar.bz2"
  else
    DEPSFILE="$SRCDIR/$PRGNAM-vlcdeps_unrestricted-$ARCH.tar.bz2"
  fi
  [ ! -f $DEPSFILE ] && DEPSFILE="$SRCDIR/$PRGNAM-vlcdeps-$ARCH.tar.bz2"

So, if you too need to create two versions of the package (for instance if you distribute your package inside the US) it is up to you to rename the DEPSFILE “vlc-vlcdeps-$ARCH.tar.bz2” after you created it. You should add the string “restricted” or “unrestricted” to its name depending on whether it contains patented code or is unrestricted.

Have fun! Eric

LibreOffice 3.5.0 is out… no Slack packages yet

Last week, the Document Foundation released version 3.5.0 of their LibreOffice suite.

Read all about it in their official announcement “the best free office suite ever“. LibreOffice has made great strides ever since it was forked off OpenOffice. On LinuxQuestions.org, which hosts my favourite Slackware forum, LibreOffice was chosen by its member community as Office Suite of the Year (with 81.01% of the votes). Bravo!

Of course, I wanted to have Slackware packages ready ASAP. Silly me… the developers are changing the build process with each new release cycle. The 3.3 -> 3.4 switch gave me headaches and 3.4 -> 3.5 is no different. In fact, it is even worse. The build system is moving toward using standard autoconf/automake/make tooling, and piece-by-piece getting rid of java/dmake for its compilation. This means, I had to revise my libreoffice.SlackBuild script again.

Unfortunately I did not have the chance (due to time constraints) to test beta builds, so now that the release is there, I am faced with an inability to compile new packages…

I have been running compilations for days, breaking off after 12+ hours repeatedly, and currently I can’t even get past the “configure” stage… being stuck at a horribly broken SlackBuild script.

No doubt I will eventually succeed, and present you some nice packages, but not soon. Terribly sorry, but I thought I would at least let you know.

In the meantime, I did manage to build VLC packages (which you can read all about in my previous post) and soon some new QEMU and qemu-kvm packages. A lot of my time is currently spent on a new ARM port of Slackware. I hope to write some more about that too, in the near future.

Cheers, Eric

VLC media player at version 2.0.0

Videolan developers finally got rid of all the blocking bugs and released the newest installment of the massively popular Open Source all-purpose media player VLC.

Initially meant to become version 1.2.0, the decision was made some months ago to change the version to 2.0.0 because of the many differences to the previous release series 1.1.x.

Get over to the VideoLAN web site and read trough the announcement. Also check out the list of new features and enhancements on that page!

For users of my Slackware packages, this news is not changing much. If you have been using my “vlcgit” package, you will have experienced a lot already of vlc 2.0.0. I have been building GIT snapshots for quite a while. Just be aware that with the official release of 2.0.0, my “vlcgit” package has become obsolete. I have removed it from my repository. Perhaps when I start building snapshots of a new release cycle (2.1 ?) you will see the vlcgit package return.

Enough said – you should get the freshly compiled VLC packages for Slackware now. They are available for Slackware 13.37 (on which I compiled them) but will work on Slackware-current too of course.

The usual caveat applies: versions that can not only DEcode but also ENcode mp3 and aac audio can be found in my alternative repository where I keep the packages containing code that might violate stupid US software patents.

There are other mirrors too of my SlackBuild package repositories – if you cannot find them, give me a yell..

 

Have fun! Eric

« Older posts

© 2024 Alien Pastures

Theme by Anders NorenUp ↑