HOWTO: Install Java6 on a pelicanHPC live CD

View: New views
3 Messages — Rating Filter:   Alert me  

HOWTO: Install Java6 on a pelicanHPC live CD

by maddanio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Here is a little howto add java6 (or basically any package that has a click-through license) to the pelicanHPC CD.

I will just dump here the relevant sections I put into the makePelican script. It goes into any of the chroot_local-hooks. What it does is just copy a bit into a configuration file of debconf that makes it think you already accepted the sun license, and then "manually" installs java. This is a hack though. I think the proper way to do this is somehow related to the term "debconf preseeding", that could enable you to put this stuff (i.e. accepted license) into debconf before all the packages are installed, and then you'd just have to put java into the package list. That said, it works beautifully this way :).

>>>> section start >>>>

######### manually install java ##############
cat <<JAVA > config/chroot_local-hooks/hook02.sh
cat <<HACKS >> /var/cache/debconf/config.dat
Name: shared/accepted-sun-dlj-v1-1
Template: shared/accepted-sun-dlj-v1-1
Value: true
Owners: sun-java6-bin, sun-java6-jre
Flags: seen
HACKS
DEBIAN_FRONTEND=readline sudo apt-get -y install sun-java6-jre sun-java6-jdk sun-java6-bin
JAVA
chmod +x config/chroot_local-hooks/hook02.sh


<<<<<< section end <<<<<


You also need the following bit that adds the non-free section to the sources:


>>>>> section start >>>>>

############ repositories    ####################
cat <<REPOSITORIES > config/chroot_sources/live.bootstrap
deb ftp://ftp.debian.org/debian $DISTRIBUTION contrib non-free
REPOSITORIES

<<<<< section end <<<<<

To generalize this to any other package with a clickthrough license you ne3ed to do one install of the package "by hand" i.e. install and click through the license. Best do this in the pelicanHPC chroot environment (i.e. chroot $ARCH/frontend/chroot). Then open /var/cache/debconf/config.dat and look for a new entry (you could keep the old file and use diff to make this easier). Then copy that section above between "cat <<HACKS >> /var/cache/debconf/config.dat" and the final "HACKS". Finally add your package to the "DEBIAN_FRONTEND=readline sudo apt-get -y install sun-java6-jre sun-java6-jdk sun-java6-bin" line and make sure the repository it is from is in sources.list, i.e. add it to the second section above if neccessary.

Best

Daniel

Re: HOWTO: Install Java6 on a pelicanHPC live CD

by Michael Creel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks!

Re: HOWTO: Install Java6 on a pelicanHPC live CD

by Michael Creel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

An easier way to do this was posted to the Debian Live mail list - see:
http://lists.debian.org/debian-live/2009/04/msg00141.html