Movix from HDD for Linux Newbies and Windows users

This HOWTO is based upon the 2 following HOWTO and upon my newbie experience.

I give special thanks to Balázs Bárány who is the original author of the method.

Sources:

http://sourceforge.net/forum/forum.php?thread_id=852296&forum_id=207428

http://sourceforge.net/forum/forum.php?thread_id=824524&forum_id=207428

This home-made HOWTO works correctly with my configuration, but you will perhaps have to modify some parameters for it to work on your config if you don’t exactly proceed as I did.

As an info, my aim was to make a real standalone player, so my HDD is an old little HDD of 170Mo, and is connected on the first IDE port as a Master (that’s important for the drive description in the files we will create/modify). This HDD will just have a primary partition, and will only be used for this purpose.

The place of the CDROM drive doesn’t matter (it can be the slave on IDE1 or Master or Slave on the IDE2). The best way to install Movix on your HDD is to connect (just for the installation) 2 CDROM drives (one containing Knoppix, the other one containing the Movix CD).

Notes for really newbies (as I am ;) in linux):

in the following lines, all the characters set after a # are comments, so you don’t have to type them, it’s only supplementary help! Just type what’is in blue characters!

If you can’t access a directory, or can’t save a file: it’s a rights problem, so, just chmod it. The way to do so is:

   -   for a file: go in the directory the file is in with the root-shell, and type: chmod 777 myfile.itsextension ( chmod will make the file readable, writable and executable for all.)

   -   for a directory, in the root-shell, you just have to go up of one directory by typing “cd ..”, and then type “chmod 777 mydirectory

So, we can begin, step by step. That’s the way I proceeded, and it worked fine. (I hope it will be OK for you).

What you need

1)     A Knoppix linux distro (http://www.knoppix.com)

2)     A Movix CD burnt from the downloaded image (http://prdownloads.sourceforge.net/movix/movix-0.8.0pre4-iso.zip?download)

3)     A HDD of more than 26Mo ( ;) )… should’nt be hard to find J

Let’s begin : preparing the HDD

1)     Boot the Knoppix CD

2)     Get a root Shell ( K Menu => Knoppix => RootShell)

3)     Type “cfdisk” (without “”)

4)     In cfdisk, first erase all the partions that exist (if they exist), then, create a new principal partition. Partition type has to be 83! (by default cfdisc proposes 82). You can add the “Boot” flag for the disc, but it is not necessary because we will use a boot-manager. Once done, write the partition table. If the drive is on IDE1 as a master, the name of the partition should be “hda1”. Else, remember the name of this partition !!! You can now exit cfdisk

5)     In the RootShell, type “mke2fs /dev/hda1” (hda1 or whatever your partition is called) to create an empty linux partition.

 

Installing boot manager (GRUB) and copying the files

 

1)     Firstable, we’re going to mount the HDD device, to be able to work on it:

 

In the Root-shell type:

 

mkdir /mnt/grub-boot

mount /dev/hda1 /mnt/grub-boot  # hda1 is the partition name we created, so if it’s another name, change it. Now your HDD is known as to be /mnt/grub-boot.

 

2)     Now, we will copy the Movix CD files to the HDD. The easiest way to do so is to proceed as described:

 

Click the icon that represents your HDD on the desktop (for me it’s hda1). This will open a new “exporer” window. In the menu, click “View”=>”Show hidden files”

Proceed the same with the CROM drive icon that contains your Movix CDRom.

 

Now, just select all directories except “isolinux” directory in the Movix CD, and drag and drop them into the HDD window. Select “copy to”.

 

On the HDD, create a new directory called “kernel”

In that directory, copy the following files from the Movix CD:

   -   initrd.gz ( from /isolinux)

   -   vmlinuz (from /isolinux/kernel)

 

Now, select all the files and directories on the HDD, and right click=>properties=>permissions=>then check all the checkboxes to make all r-w-x, select “apply to all subdirectories”, and apply.

 

When done, we’ll install GRUB, the boot-manager.

 

3)     Installing GRUB

 

In the Root-Shell, type:

 

Grub-install –root-directory=/mnt/grub-boot /dev/hda # hda or whatever your partition is called, without the number! (for example hdb, hdc, hdd).

 

Grub will ask you to wait while checking all drives, and ask you if the found drives are OK. You should see 2 lines: one for the Floppy, the other one for the HDD.

 

4)     Now we’ll modify the Movix file to make it bootable from the HDD if no Movix CD is present:

      a)Preparing the initrd to be able to edit it:

 

Decompress the initrd.gz:

In the root-shell type:

cd /

cd /mnt/grub-boot/kernel

gunzip initrd.gz

Don’t close your root-shell.

You now have a file named initrd instead of initrd.gz in the “kernel” directory.

Cut it and paste it in the root of your HDD (with the “exporer” or in the root-shell)

 

Now, mount the initrd file to be able to edit it:

cd .. # to return to root of the HDD

mkdir mountdir # creates a directory named “mountdir”

mount –o loop initrd mountdir # mounts initrd to be able to edit it

With the “explorer”, select the files located in the “mountdir” directory, and make them readable, writable, and executable, and so on for the subdirectories (as seen below).

 

b)     Let’s apply the patch to be able to boot from HDD if no Movix Cd is present:

 

While you are in this directory (“mountdir”), find the file placed in /etc/rc.d and named “rc.S”.

Right click on it, and select “open with=>Kate”.

Kate is a text-editor that will allow us to modify the file rc.S

 

In Kate, find the lines that read :

"################################### Checking that everything went ok"
and put the following just before them:

# Patch for mounting a HD partition instead of the MoviX CD
if echo "$MOVIX_HD" | grep '^/dev/' ; then

if [ -z "$MOVIX_HD_TYPE" ]; then
# default: auto - could work
MOVIX_HD_TYPE=ext2
fi

if mount -r -t "$MOVIX_HD_TYPE" "$MOVIX_HD" /cdrom ; then
if [ -e /cdrom/movix/rc.movix ] ;
then
echo "Found MoviX on $MOVIX_HD!"
cp /cdrom/movix/rc.movix /etc/rc.d
break
else
umount /cdrom
continue
fi
else
echo "Couldn't mount $MOVIX_HD"
fi
fi
#wait a bit in case of errors
sleep 5
# End patch

Save the file and leave the editor.

We can unmount the mountdir directory:

In the root-shell type:

umount mountdir/

 

c)     Configuring the boot-manager:

From the Knoppix K-menu:

K=>editors=>Kate

Type the following lines in the empty new-file:

 

# Add a MoviX section:
title MoviX from hd  # or whatever you want after “title”
# Change to the hd where initrd and vmlinuz are
root (hd0,0)
# Kernel: you can/should edit the LABEL, video, vga, MOVIX_HD, MOVIX_HD_TYPE parameters (caution: it is ONE line !!!)
kernel /path/to/vmlinuz root=/dev/ram0 load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=30000 rw LABEL=MoviX video=vesa:ywrap,mtrr vga=0x314 MOVIX_HD=/dev/ide/host0/bus0/target0/lun0/part1 MOVIX_HD_TYPE=ext2

# ramdisk_size=30000 is the ram allocation to load the files. The files need 26000 to be loaded correctly, so with 30000 we’re OK. Else, you should have the message “Kernel Panic : VFS : unable to mount root fs on 01:00” when booting from HDD.
# MOVIX_HD is the unix-permission-compatible partition where your /movix directory is. In this case, part1 is the 1st partition of the HDD, i.e. the one we created in cfdisk.
# MOVIX_HD_TYPE is its filesystem type, e.g. ext2 if you selected 83 in cfdisk
# and now the initramdisk
initrd /initrd

 

Save this newly created file as “menu.lst” in the following directory:

/mnt/grub-boot/boot/grub/

Be sure this new file is r-w-x

 

WELL, WE’RE DONE!

 

All you need now is to exit Knoppix.

 

Then go to the BIOS menu to change your boot sequence to boot from HDD and then…

 

Just BOOT AND ENJOY!!!

 

 

 

TIP:

In the case your system doesn’t boot, because the files we created and modify contain errors (type mistake for example), you can reboot the Knoppix CDROM to make the modifications. But be careful: When you boot knoppix, if you go and click the HDD icon, you will NOT have the right write permission on the files, even if you are the one that created them!!!

To avoid this, when booting from Knoppix CD, don’t click the HDD icon before doing this operations:

 

Open a root-shell

In the Root-shell type:

 

mkdir /mnt/grub-boot

mount /dev/hda1 /mnt/grub-boot  # hda1 is the partition name we created, so if it’s another name, change it.

 

Then, you can access your HDD by clicking the HDD icon on the desktop, and have the rights to modify the files.

 

Cyberfrancis