[LIVE] Option to install XBMC Live to SATA and PATA/ATA/IDE harddrive

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
s7mx1 Offline
Senior Member
Posts: 259
Joined: Dec 2007
Reputation: 3
Post: #21
Put up a project on google. The detailed installation is on the following page:

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

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
find quote
red_lego_man Offline
Junior Member
Posts: 39
Joined: Mar 2008
Reputation: 0
Post: #22
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:
Code:
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...
find quote
red_lego_man Offline
Junior Member
Posts: 39
Joined: Mar 2008
Reputation: 0
Post: #23
red_lego_man Wrote: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.
find quote
red_lego_man Offline
Junior Member
Posts: 39
Joined: Mar 2008
Reputation: 0
Post: #24
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.
find quote
topfs2 Offline
Team-XBMC Developer
Posts: 3,825
Joined: Dec 2007
Reputation: 8
Post: #25
s7mx1 Wrote: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.

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
s7mx1 Offline
Senior Member
Posts: 259
Joined: Dec 2007
Reputation: 3
Post: #26
Topfs2 Wrote: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
find quote
s7mx1 Offline
Senior Member
Posts: 259
Joined: Dec 2007
Reputation: 3
Post: #27
red_lego_man Wrote: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.
find quote
xentro Offline
Junior Member
Posts: 3
Joined: Sep 2008
Reputation: 0
Post: #28
red_lego_man Wrote: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:
Code:
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:
Code:
mkfs.vfat -I -F [b]32[/b] -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 ...)

Code:
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. Wink

Hello

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

Best regards
find quote
s7mx1 Offline
Senior Member
Posts: 259
Joined: Dec 2007
Reputation: 3
Post: #29
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/
find quote
s7mx1 Offline
Senior Member
Posts: 259
Joined: Dec 2007
Reputation: 3
Post: #30
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.
find quote