PDA

View Full Version : [LIVE] Option to install XBMC Live to SATA and PATA/ATA/IDE harddrive


InDashMP3
2008-09-18, 19:41
Wow! Great work on the beta, and the LIVE packaging. Have no media on this test machine right now, but the HD interface/sounds/etc are great.

Question - The Options presented are ATI/Nvidia/Intel, and install to USB. The small size of this package and integrated o/s are very disireable. I have a SATA to CF adapter, and successfully configured Ubuntu Mini to run with XBMC, but would much rather install this package to my CF. It appears as though the install will not work unless a removable drive is installed (which makes sense as this is how this release is targetted). Is there any way to simply install to Hard Disk this version? Basically, an all in one package for hard disk install. Thanks again!

l.capriotti
2008-09-18, 20:58
short answer: yes there is.

Long answer: we still need to arrive to the point where that could be done easily, so for the moment we are going for removable media only.
Stay tuned, booting from fixed disks will happen!

EvilDevil
2008-09-18, 21:13
Hi,

there's a dirty way to install it manually.
You need a recent linux distro installed on your computer (a linux live cd should do the job too, e.g. http://www.sysresccd.org/Main_Page ).
Mount the CD on /media/cdrom
Mount the rootfs image(squashfs) from the cdrom to /mnt:
mount -o loop /media/cdrom/rootfs.img /mnt
Mount the target disk:
mkdir /media/target
mount /dev/sdXX /media/target
cp -a /mnt/* /media/target
umount /mnt

(Only for AMD/ATI graphics):
mount -o loop /media/cdrom/restrictedDriver.amd.img /mnt
cp -a /mnt/* /media/target

(Only for NVidia graphics):
mount -o loop /media/cdrom/restrictedDriver.nvidia.img /mnt
cp -a /mnt/* /media/target

(Use this only if you know what you're doing, this alters your boot sector!)
mkdir /media/target/boot
cp /media/cdrom/initrd* /media/cdrom/vlinuz /media/target/boot
cd /media/target
mount -o bind /dev dev
mount -o bind /tmp tmp
mount -o bind /proc proc
mount -o bind /sys sys
chroot .
(This is untested!):
grub-install /dev/sdXX
# Add the initramdisk and the vmlinuz file to the /boot/grub/menu.lst

Hope this helps.

Regards,
Patrick

Gamester17
2008-09-18, 21:35
@InDashMP3, please submit a new feature request ticket on trac for this:
http://xbmc.org/trac

May I suggest you use the topic:
"[LIVE] Option to install XBMC Live to SATA and PATA/ATA/IDE harddrive"

InDashMP3
2008-09-19, 00:23
Thanks! Ticket #4911 created for this feature request. Unfortunately, TRAC did not allow me to select Beta 1 for Version, and I wasn't sure what to select for Milestone either.

Kprojekt
2008-09-19, 06:55
Was wondering if it is possible to mount XBMC Live onto the main HDD and use that to boot the system instead of a CD or USB.

CD works fine, USB worked once and now it stopped.

Also is it possible to save the settings after reboot?

pike
2008-09-19, 07:08
"LiveCD" kinda negotes that

But LiveUSB should support saving settings

Kprojekt
2008-09-19, 07:13
I suppose it does. I just like the fact it's a self contained system and I don't have to muck around with Linux settings to get everything up and running.

Guess I have to purchase a better USB Stick > My current solution is Micro SD in a USB 2.0 Hub

Kprojekt
2008-09-19, 08:55
So regardless of the USB I've managed to make it work.

The only problem is the device will automatically boot to vista even if USB is in top priority on the Bios setup. To remedy this I removed C altogether from the BIOS which resulted in losing the mounting options of my main drive in XBMC

Fragadelic
2008-09-19, 16:56
Good stuff. The livecd works and plays on my AthlonXP 2400+ with 256MB ram/7600gs agp quite nice.

Having the option to install from the live would be a huge plus as my old system I want to run this on can't boot from usb.

butchjr
2008-09-20, 18:30
I really love XBMC Live, but I would love it even more if I could install it on my harddrive, for permanent boot. I use Hardy + XBMC right now. But why not use the XBMC Live, as it boots much faster.

What I would like to do is autoboot XBMC Live with Nvidiagfx from my main harddrive.

If anyone could help me, step-by-step, I would be very thankful!

/Björn

vectorite
2008-09-21, 19:53
a simple search finds this:

http://xbmc.org/forum/showthread.php?t=37317

butchjr
2008-09-22, 00:11
I have seen that one. But it doesn't seem easy to me ;)

s7mx1
2008-09-23, 17:37
Be aware the following method will wipe any data on your first hard disk, use with caution.


When you boot up the live cd, switch to the console by press ctrl + alt + f1, and log in as root (there is no password set), and issue the following command:

vim /usr/bin/mkLiveUSB.sh -c :9,131d -c ":8s/.*/export removableDrives=sda" -c :w\!mkdisk.sh -c :q\!

chmod +x mkdisk.sh
./mkdisk.sh


the above newly created script will install xbmc for you on the first hard drive (in this case sda which is the first hard disk recognized by linux). Be aware the script will wipe any data on it. There is no size limitation on it so make sure there is plenty space on your hard disk.

No offense but the original installation script is by no means a well tested and stable one and also the way the usb disk is done (I mean the internal disk image structure and boot loader [actually chain loaded from lilo to syslinux ]) is really awkward to me. If I have time probably I will "fix" it so it looks more naturally to me.


Hi,

there's a dirty way to install it manually.
You need a recent linux distro installed on your computer (a linux live cd should do the job too, e.g. http://www.sysresccd.org/Main_Page ).
Mount the CD on /media/cdrom
Mount the rootfs image(squashfs) from the cdrom to /mnt:
mount -o loop /media/cdrom/rootfs.img /mnt
Mount the target disk:
mkdir /media/target
mount /dev/sdXX /media/target
cp -a /mnt/* /media/target
umount /mnt

(Only for AMD/ATI graphics):
mount -o loop /media/cdrom/restrictedDriver.amd.img /mnt
cp -a /mnt/* /media/target

(Only for NVidia graphics):
mount -o loop /media/cdrom/restrictedDriver.nvidia.img /mnt
cp -a /mnt/* /media/target

(Use this only if you know what you're doing, this alters your boot sector!)
mkdir /media/target/boot
cp /media/cdrom/initrd* /media/cdrom/vlinuz /media/target/boot
cd /media/target
mount -o bind /dev dev
mount -o bind /tmp tmp
mount -o bind /proc proc
mount -o bind /sys sys
chroot .
(This is untested!):
grub-install /dev/sdXX
# Add the initramdisk and the vmlinuz file to the /boot/grub/menu.lst

Hope this helps.

Regards,
Patrick

l.capriotti
2008-09-23, 19:14
No offense but the original installation script is by no means a well tested and stable one and also the way the usb disk is done (I mean the internal disk image structure and boot loader [actually chain loaded from lilo to syslinux ]) is really awkward to me. If I have time probably I will "fix" it so it looks more naturally to me.

no offense at all. Looking forward to see your version of the install script, handling both USB and fixed disks!

crackerbox
2008-09-24, 00:22
I got this working by doing the manual dirty method.

It boots up real nice and fast with grub.

I'm thinking about using a partition like this to replace the mediadirect partition on me dell laptop...

s7mx1
2008-09-24, 12:44
no offense at all. Looking forward to see your version of the install script, handling both USB and fixed disks!

Thanks for understanding.

I realised that the shipped livcd is not a highly modified version of Ubuntu. The progress is quite smooth. The boot loader, rootfs, partitions for nvidia and amd restricted drivers are all done. All I need to do is to write a compatible script in the initramfs so it will handle the merge of filesystem using unionfs like you guys did and couple of xmbc variables (probably just copy and paste). It really does not matter if the system is located on a usb disk or a local hard drive as long as the right module can be loaded into kernel which is the job of udev.

I hope it will finish in one day or two then I can post it here. After that I will try to make it network (san) boot which I have quite a few experience with, but it may be tricky since it needs to detect and bring up the network card before mounting the disk.

Cheers,
sam

red_lego_man
2008-09-25, 12:55
I used the mkLiveUSB.sh script to write the live image to HDD instead of USb, by removing the "if removable drive" statement and then choosing hda from the list. i.e: lines 35 - 46 on mkLiveUSB.sh:
if [ -b /dev/${device} ]; then
#if [ -e /sys/block/${device}/removable ]; then
#if [ "$(cat /sys/block/${device}/removable)" = "1" ]; then
echo "Found removable drive."
removableDrives[${nRemovableDrives}]=${device}
let "nRemovableDrives = $nRemovableDrives + 1"
found="yes"
#else
#echo "Not removable ."
#fi
#fi
fi

I also needed to change line 156 to format the partition to FAT32 instead of FAT16 as an HDD is too big for FAT16:
mkfs.vfat -I -F 32 -n XBMCLive /dev/${removableDrives[$index]}1 &> /dev/null

Also, I then needed to change syslinux.cfg to have boot=disk instead of boot=usb, otherwise I got stuck in the "searching /dev/scd0,1,2,3 for installation source" loop (problem with /etc/initramfs-tools/usb ??):
(also altered to auto-boot nvidia after the timeout ...)


display boot.msg
prompt 1
timeout 30
CONSOLE 1

default 1

# nVidia
label 1
kernel vmlinuz
append initrd=initrd0.img boot=disk splash xbmc=nvidia

# AMD
label 2
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=amd

# Intel
label 3
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=intel

#MkUSB
label 0
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=mkusb

#Safe mode
label safe
kernel vmlinuz
append initrd=initrd0.img boot=disk

label toramintel
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=intel,boottoram

label toramnvidia
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=nvidia,boottoram

label toramamd
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=amd,boottoram


So now I have a lovely xbmc system running from the internal HDD. Super.

This is a horrible cludge, but there you go. ;)

s7mx1
2008-09-25, 16:42
no offense at all. Looking forward to see your version of the install script, handling both USB and fixed disks!

The script is ready, need find time to write the document and place to host an initial disk image (about 14M)

The purpose of the script is to build an unified image for usb pen drive, hard disk and san network boot. The first two goals has been achieved.

The script will generate a raw 4G disk image and you will have the freedom to put it onto your usb pen drive, hard disk or your server for network booting. The script I personally think is a reverse process of the usb installation script found in the Live CD, as It tries to unpack three raw images to disk partitions. Hope linuxer out there will appreciate it.

changes made so far

* use grub as the boot loader for easy live modification of kernel options
* add a boot script in initramfs to handle graphic drivers according to xbmc kernel options
* usplash resolution changed to 1024x768
* changed /usr/bin/diskmounter to by-pass xbmc system disks
* added a swap partition to /etc/fstab

To do

* build a new initramfs to include the support of san boot (aoe + iscsi)
* investigate how to check ext3 disk in the initramfs environment.

Upgrades to the upcoming Atlantis release will be very easy. Since all modified files were saved in separate locations, one simple update script will do the trick and user changes (documents, settings for example) will not be lost during the upgrade. The resulting 4G disk image can be scaled up or down by the end user using common tools.

Stay tuned.

red_lego_man
2008-09-25, 18:16
Any chance of taking a look at what you've got so far? I'd love to poke around just to learn about it all.

s7mx1
2008-09-25, 18:29
Any chance of taking a look at what you've got so far? I'd love to poke around just to learn about it all.

Hopefully you will get it tomorrow. I have written the documents. But have to test it tonight using a real pc to make sure it's all working.

Cheers,

s7mx1
2008-09-26, 11:03
Put up a project on google. The detailed installation is on the following page:

http://code.google.com/p/xbmc-image/wiki/HowToGenerateADiskImage

Changes from yesterday

* added an init script to remove any xbmc system partition node (/dev/sda1 or example) to force xbmc to ignore them
* modified /usr/bin/diskmounter to use vol_id to detect mountable partition instead of unreliable fdisk string

Personally I feel diskmounter script is not necessary since xbmc will try to mount any unmount partitions every 10 seconds.

Limitations
* Since it's all based on the Live CD, the hardware detection will still be the same as the original CD, i.e. if you hardware was not found in Live CD it's likely it will not work in the disk version
* You cannot upgrade the kernel at the moment or anything involving upgrade initramfs. This will bef fixed when network boot version is out.
* When XBMC exited unexpectedly, fluxbox will be started instead of xbmc. This probably is the bug of LiveCD. If it's not fixed in the release version of LiveCD, I will try to have look at them.
* Don't expect too much

red_lego_man
2008-09-26, 16:16
OK, I've tried this out, both by hand and simply using the script - when I get to test this using qemu, the boot gets stuck:
Mounting: mount -o rw /dev/sda1 /container
mount: Mounting /dev/sda1 on /container failed: Invalid argument
Did not find /container/rootfs.img
sleeping for 0.5 seconds
over and over and over...

red_lego_man
2008-09-26, 16:36
OK, I've tried this out, both by hand and simply using the script - when I get to test this using qemu, the boot gets stuck:

over and over and over...

No, that was me being a fumb ducker. Typo in menu.lst. sorry.

red_lego_man
2008-09-26, 21:46
Sam,
This is pretty good - it's good to have grub back, and to have some swap.
Now, would it be possible to include a script which allows you to create the initial image file (xbmc-beta-4G.img in your case), so you have freedom over the size? It would be good to be able to size it up to 8GB or down to 2GB for example. Choosing the size of the user partition would also be quite nice.

topfs2
2008-09-27, 11:03
Personally I feel diskmounter script is not necessary since xbmc will try to mount any unmount partitions every 10 seconds.


Uhm what? Can you explain this?
If your refering to XBMC's HalManager that is mounting the removable drives on the system then no, it's eventbased.
XBMC will get an event from Hal whenever a new disk is present and will mount it if it fits the profile we have, ie if it's removable, if it's using a correct filesystem.

So XBMC will only mount a disk once.

s7mx1
2008-09-27, 14:58
Uhm what? Can you explain this?
If your refering to XBMC's HalManager that is mounting the removable drives on the system then no, it's eventbased.
XBMC will get an event from Hal whenever a new disk is present and will mount it if it fits the profile we have, ie if it's removable, if it's using a correct filesystem.

So XBMC will only mount a disk once.

The XBMC's HalManager is the way to do it. I was referring to the
/usr/bin/diskmounter script, which I modified to use vol_id to detect mountable partitions. It probably was a legacy script before XBMC has the halmanager integrated. The system will call the script before starting xbmc and also it's presented in /etc/rc.local

s7mx1
2008-09-27, 15:13
Sam,
This is pretty good - it's good to have grub back, and to have some swap.
Now, would it be possible to include a script which allows you to create the initial image file (xbmc-beta-4G.img in your case), so you have freedom over the size? It would be good to be able to size it up to 8GB or down to 2GB for example. Choosing the size of the user partition would also be quite nice.

Thanks. If you have transfered the image to the hard disk. It's possible to extend the partition by removing partition 4 5 6 7 and then recreated extended partition 4 to fill the rest of the disk. Then create partition 5 which is the system root partition having the cylinder number from 40 to 164. partition 6 starts at cylinder 165 and end cylinder must be larger than 363. The last partition 7 is the swap partition.

After partition 6 is recreated, you can resize it by using resize2fs against to that partition (you need to run fsck before that) and make sure when you reformat the swap partition make sure it has label xbmc_swap, i.e. mkswap -L xbmc_swap.

Right now I have no plan for such automatic script as I am focusing on san boot. However I do plan later when san boot is finished, a new smaller image will be created so user partition will be created upon the first booting to extend to the full disk.

xentro
2008-09-29, 12:28
I used the mkLiveUSB.sh script to write the live image to HDD instead of USb, by removing the "if removable drive" statement and then choosing hda from the list. i.e: lines 35 - 46 on mkLiveUSB.sh:
if [ -b /dev/${device} ]; then
#if [ -e /sys/block/${device}/removable ]; then
#if [ "$(cat /sys/block/${device}/removable)" = "1" ]; then
echo "Found removable drive."
removableDrives[${nRemovableDrives}]=${device}
let "nRemovableDrives = $nRemovableDrives + 1"
found="yes"
#else
#echo "Not removable ."
#fi
#fi
fi

I also needed to change line 156 to format the partition to FAT32 instead of FAT16 as an HDD is too big for FAT16:
mkfs.vfat -I -F 32 -n XBMCLive /dev/${removableDrives[$index]}1 &> /dev/null

Also, I then needed to change syslinux.cfg to have boot=disk instead of boot=usb, otherwise I got stuck in the "searching /dev/scd0,1,2,3 for installation source" loop (problem with /etc/initramfs-tools/usb ??):
(also altered to auto-boot nvidia after the timeout ...)


display boot.msg
prompt 1
timeout 30
CONSOLE 1

default 1

# nVidia
label 1
kernel vmlinuz
append initrd=initrd0.img boot=disk splash xbmc=nvidia

# AMD
label 2
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=amd

# Intel
label 3
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=intel

#MkUSB
label 0
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=mkusb

#Safe mode
label safe
kernel vmlinuz
append initrd=initrd0.img boot=disk

label toramintel
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=intel,boottoram

label toramnvidia
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=nvidia,boottoram

label toramamd
kernel vmlinuz
append initrd=initrd0.img boot=disk quiet splash xbmc=amd,boottoram


So now I have a lovely xbmc system running from the internal HDD. Super.

This is a horrible cludge, but there you go. ;)

Hello

could you please tell me how can I change the syslinux.cfg?

Best regards

s7mx1
2008-09-29, 13:36
Greetings,

Finally network booting support has been added. Image and script has been updated. Was forced to used bz2 compression due to the image size increase.

Need to do documents.




Unified XBMC image generator for usb, disk and san network booting
http://code.google.com/p/xbmc-image/

s7mx1
2008-09-30, 14:40
Network boot support documents has been added.

Currently it's able to boot either from aoe or iscsi.

The total boot time from a 100M network is about 50s. Time till xbmc is started is probably longer. I managed to reduce the last figure to 47s and I believe there's still much more can be done.

Happy testing.

jimothy
2008-10-01, 16:50
Hi all, I want to support this great product which worked as advertised straight out of the box.

I have my xbmc booting from the hard drive. I installed the xbmclive to a compact flash card as per usual. Then used an ide to CF card adapter on the motherboard ide hole and boot from that. It works fine.

I would imagine you could install to ide or sata drive externally then just plug it in and away you go.

I have changed the default boot to my graphic card by editing the syslinux.cfg file and have a great system.

I do have one question. Is there any way I can increase the maximum volume (maybe a config file?) as currently it is lot quieter than other installs i have had on the same machine

Again great product

Jim

l.capriotti
2008-10-01, 18:00
you may want to jump to a console and user "amixer" to set master volume. This is an example:


amixer sset Master,0 99 unmute


if that works you can type that line into /etc/rc.local and have it executed at every boot.

nickvd
2008-11-21, 01:54
Any updates for the final release of Atlantis? I used the script anyway and it seemed to work (had to change the filename of course) however on boot i get about a dozen 'press any key..." prompts then it skips by and gives me an error about the resolution (installed / configured on a 19" lsd and moved to the tv) it's a simple fix, but for some reason I cannot locate syslinux.cfg or the menu.lst anywhere on the system (while it's running [like any other linux system])

(T: XBMCLiveCD)root@XBMCLive:/mnt# mount /dev/sda3 ./bootpart
mount: special device /dev/sda3 does not exist


... As i'm typing this, I rebooted onto the livecd and it was able to mount all 7 partitions and I now have access to what I need... so I'll post this anyway in case someone else has the same issue (also to bump the post) :)

Thanks for..... inspiration? ;)

s7mx1
2008-11-21, 14:53
Thanks for the feedback.

Will try to update this weekend.

Any updates for the final release of Atlantis? I used the script anyway and it seemed to work (had to change the filename of course) however on boot i get about a dozen 'press any key..." prompts then it skips by and gives me an error about the resolution (installed / configured on a 19" lsd and moved to the tv) it's a simple fix, but for some reason I cannot locate syslinux.cfg or the menu.lst anywhere on the system (while it's running [like any other linux system])

(T: XBMCLiveCD)root@XBMCLive:/mnt# mount /dev/sda3 ./bootpart
mount: special device /dev/sda3 does not exist


... As i'm typing this, I rebooted onto the livecd and it was able to mount all 7 partitions and I now have access to what I need... so I'll post this anyway in case someone else has the same issue (also to bump the post) :)

Thanks for..... inspiration? ;)

jimothy
2009-01-04, 00:05
This works great thanks a lot. i have been very busy and not had chance to try it up till now.