Archive for the 'satellite' Category

DVD player with xsessions

June 12th, 2009 | Category: Computers, Linux, satellite

I’ve come across the need to simply the dvd playing process.  I’m having to set up a laptop to play a dvd and use a remote presenter control.  Now in the past I’ve just been in charge of this setup, and haven’t had to worry about explaining how to start it up for others.  This time, I need to make it as user friendly as possible.  So, I’ve decided to do this with a couple of bash scripts and a couple of xsessions.
Goals

  • Generic user with a generic password to hand to the person in charge
  • Ability to play dvd stored locally.  (Called presentation_dvd)
  • Ability to play any dvd inserted.
  • Require no user input except to choose presentation_dvd or dvd

Preperation

To get ready, we need to do a couple of things

  • Create a presenter user
  • Install xine and xine-lib-extras-freeworld
  • Copy our presentation_dvd to an iso

    dd if=/dev/dvd of=/home/presenter/presentation_dvd.iso

Xesssions

Xsessions are what defines your window manager.  It’s what tells X11 what to run when you say Session->Gnome or Session->fluxbox.  These files are stored in /usr/share/xsessions.

[Desktop Entry]
Encoding=UTF-8
Name=Presentation_DVD
Comment=Start the presentation DVD
Exec=/usr/local/bin/presentation_dvd
Terminal=False

[Window Manager]
SessionManaged=true

This is our file in /usr/share/xesssions/presentation_dvd.desktop We then create one in /usr/share/xesssions/dvd.desktop and replace presentation_dvd with dvd.

The Scripts

Our /usr/local/bin/presentation_dvd looks like this:

#!bin/bash
amixer set Master playback 100%
xine -f -g –no-splash dvd:/home/presenter/presentation_dvd.iso

This will turn the volume up to 100% and then start xine on the iso.  To exit, just right click and say exit.  This will take you back to the login screen.

Now to handle any dvd with the /usr/local/bin/dvd

#!/bin/bash
amixer set Master playback 100%
xine -f -g –no-splash dvd://

And the final touch, make them both executable

chmod a+x /usr/local/bin/dvd /usr/local/bin/presentation_dvd

NOTE:  The xine parameter is dash dash no dash splash.  The font I’m using doesn’t render two dashes well


Usage

From the login menu, choose your presenter user, and then choose the appropriate session at the bottom.  Then type in the password.  Like magic, everything should work.

Potential problems

If you don’t see your session in the list, you might have a typo in your xsession file

If one of the xine scripts don’t work, try logging into gnome and running the script from the command-line to see why.

No comments

Custom boot isos and imgs

June 06th, 2008 | Category: Linux, satellite

I’ve spent the past couple of days banging my head against the desk trying to get this to work out correctly.  And now it finally does.  Just as a note, I’ve tested that the general steps work.  I have not verified that i haven’t skipped a step.  So if anything’s missing let me know.

Disclaimer: This has only been tested with RHEL and nothing else, but there is no reason why it won’t work.  And if you don’t have a satellite you can use this with any old kickstart.  Assuming you have the tree setup correctly.  Please test your kickstart tree first.

Satellite prep

Create your kickstart as you normally would. Then, make sure the kickstart is accessiable via the following style URL:

http://satellite.example.com/kickstart/ks/view_label/<kickstart_label>

Replace <kickstart_label> with the name of label set on the satellite.  Remember this URL, you’ll need it later

view_label VS label

In the kickstart URL, you can use either view_label or label.  view_label will not register the box if there is not an activation key set inside the kickstart.  label generates a one time use activation key and registers the box to the satellite

Why use one over the other?

view_label is good if you are using an activation key, or if you have to install a box a bunch of times, and don’t want to have a bunch of extra profiles lingering around.label is good if you don’t want to have to set up an activation key, and a machine is only going to be kickstarted once.  If you are going to be using the disk image in a PXE like fasion, view_label is your best option.

Rolling the disk image (For usb-key)

Get the first disk of what ever you are trying to install from the kickstart. For this document, I will be using RHEL 5 U2 x86_64

NOTE: The arch and update must match or it will fail.

  • Copy the images/diskboot.img file to /root/rhel5u2-64bit.img
  • Mount the /root/rhel5u2-64bit.img file on the loopback (/mnt/)
  • Edit the /mnt/syslinux.cfg file, and add/edit the following:

default custom
prompt 0
timeout 0
display boot.msg
label custom
kernel vmlinuz
append initrd=initrd.img ks=http://satellite.example.com/kickstart/ks/view_label/<kickstart_label> ksdevice=link noipv6

  • Edit the /mnt/boot.msg to say what you want. I recommend removing the lines below ’splash.lss’ and replace with something like:

Your install of Red Hat Enterprise Linux Update 2 (x86_64) will start shortly.

  • Unmount the diskboot.img file
  • Then burn to a cd, or copy to a jumpdrive with the following command:

dd if=/root/rhel5u2-64bit.img of=/dev/sdc

NOTE: Replace /dev/sdc with the device name of your jumpdrive

Rolling the disk image (For cdrom)

Get the first disk of what ever you are trying to install from the kickstart. For this document, I
will be using RHEL 5 U2 x86_64

NOTE: The arch and update must match or it will fail.

  • Copy the images/boot.iso file to /root/rhel5u2-64bit-boot.iso
  • Mount the /root/rhel5u2-64bit-boot.iso file on the loopback (/mnt/)
  • Make a directory in /tmp/ (/tmp/rhel5u2-64bit/)
  • Copy /mnt/* to that directory
  • Unmount the rhel5u2-64bit-boot.iso file
  • Remove the rhel5u2-64bit-boot.iso file to reduce confusion
  • Make the /tmp/rhel5u2-64bit/isolinux/isolinux.cfg writable by root
  • Edit the /tmp/rhel5u2-64bit/isolinux/isolinux.cfg file, and add/edit the following:

default custom
prompt 0
timeout 0
display boot.msg
label custom
kernel vmlinuz

append initrd=initrd.img ks=http://satellite.example.com/kickstart/ks/view_label/<kickstart_label> ksdevice=link noipv6

  • Edit the /tmp/rhel5u2-64bit/isolinux/boot.msg to say what you want. I recommend removing the lines below ’splash.lss’ and replace with something like:

Your install of Red Hat Enterprise Linux Update 2 (x86_64) will start shortly.

  • Then make a bootable iso by running:

cd /tmp/
mkisofs -r -T -J \
-V “RHEL 5u2 x86_64 kickstart iso” \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-v -o “/root/rhel5u2-64bit.iso” /tmp/rhel5u2-64bit/

  • The burn the cd as a cd image

Boot

The insert the media into the machine and boot off of it.

No comments