Page 1 of 13

HOWTO: Fully Native

Posted: Thu Jul 14, 2005 8:34 am
by cheesyboofs
Fully Native Tutorial:

Right I have trawled this forum and xbox-linux site and this is where I'm at. This tutorial looks complicated but its not, it just list EVERYTHING you need to do word for word.

**Warning: if you follow this tutorial you will end up with a very good inexpensive file 'server' you will there for NOT be able to play ANY Xbox games, dashes or anything remotely hookie, not only that it will take a certain amount of work to put it all back. This is purely for people with to much time, money and usually more than one Xbox (I now have three!)**

My setup on my test Xbox, but any config will do,
Xbox = 1.3
Flash = TSOP Gentoox BIOS (v6.x)
HDD = Stock (Bigger would be better)

You will need a copy of Restoox v5.x burnt onto a CDRW and a copy of the fantastic Gentoox Pro 4.x (this can stay as an .ISO as you can extract the relevant files with winrar or isobuster)

CD Install Method,
First boot off the Restoox v5.x or above,
It boots up with an IP address of 192.168.1.13 so you will need to add an ip to your PC -> right click network icon -> properties -> right click Local Area Connection -> properties -> double click internet protocol TCP/IP -> click advanced -> then add an IP address in the top box -> 192.168.1.100/255.255.255.0 there you go your PC now has two ip addresses, not many people know that can be done.
*If your PC is already on the 192.168.1.* network you dont need to do the above*

Now download Putty and connect to 192.168.1.13
User:root
Password:xbox
# cd /
# ls

Image

Partitioned the disk up with a 256Mb swap partition at the front /dev/hda1 and the rest, 9Gb'ish /dev/hda2
# fdisk /dev/hda

Image

Delete current disk configuration:
p (print the current hard drive layout)

Command (m for help): d
Partition number (1-4): 1 (keep deleting till all are gone)

Create Swap partition:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3876, default 1): (Hit Enter)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): +256M

After you've done this, type t to set the partition type, 1 to select the partition you just created and then type in 82 to set the partition type to "Linux Swap"

Create the rest for usable space:
To do this, type n to create a new partition, then p to tell fdisk that you want a primary partition. Then type 2 to create the second primary partition, /dev/hda2 in our case. When prompted for the first cylinder, hit enter. When prompted for the last cylinder, hit enter to create a partition that takes up the rest of the remaining space on your disk.

Lastly we mustn't forget to make the partition bootable to do this type a to toggle the bootable flag on a partition and select 2. If you press p again, you will notice that an * is placed in the "Boot" column.

After completing these steps, typing p should display a partition table that looks similar to this:
Device Boot Start End Blocks Id System
/dev/hda1 1 497 250456+ 82 Linux swap / Solaris
/dev/hda2 * 498 19846 9751896 83 Linux


Image
"Here we can see that my hda2 is about 200Gb yours will be different!"

Typing w will then quit saving the config to disk.

And format,
# mke2fs -j /dev/hda2
# mkswap /dev/hda1
# swapon /dev/hda1


Image

Then mount the newly formatted drive;
# mkdir /mnt/hda2 && mount /dev/hda2 /mnt/hda2

Then copy over the roofs file out of the distro.rar to /mnt/hda2 by FTP'ing to 192.168.1.13 from windows, anonymous login;
Then mount the file;
# mkdir /mnt/loopback && mount -o loop /mnt/hda2/rootfs /mnt/loopback

Image

Then copy all the files from the rootfs to the new drive;
# cp -a /mnt/loopback/* /mnt/hda2
# ls -l /mnt/hda2


Image

Clean out /boot
# rm /mnt/hda2/boot/*

Then when that's done copy over linuxboot.cfg and vmlinuz (Warning! Case sensitive) via FTP again, also obtained from the distro.rar to /mnt/hda2/boot/
# ls -l /mnt/hda2/boot
total 5144
-rw-r--r-- 1 root root 145 Jul 19 20:03 linuxboot.cfg
-rw-r--r-- 1 root root 1057951 Jun 4 13:19 vmlinuz


(NOTE! If you can't use nano don't worry just edit the next two files under windoze in word pad then FTP them over)
If you just can't be arced to edit the files your self then you can download them here already edited.


Then edit linuxboot.cfg;
#nano /mnt/hda2/boot/linuxboot.cfg
title Gentoox
kernel /boot/vmlinuz
initrd no
append init=/linuxrc root=/dev/hda2 kbd-reset video=xbox:640x480,nohwcursor,hoc=13,voc=13 dontdeleteme


Image

Then edit the fstab on the new drive;
#nano /mnt/hda2/etc/fstab
/dev/hda1 none swap sw 0 0
/dev/hda2 / ext3 defaults 0 1
Proc /proc proc defaults 0 0


Image

And then reboot;
# halt

Power back up and login, It will now have a new IP address, as it boots using DHCP, look at you router or the TV screen to see what the new ip address is.
User: root
Password: xbox

# cd /
# passwd

new password: (new root password)
re-type new password
# passwd gentoox
new password: (new gentoox password)
re-type new password
# rm -rf /mnt/fatx/e; ln -sf /boot /mnt/fatx/e this should make this native install compatible with future magic kernel updates
(time will tell, it will send any new boot files destined for /mnt/fatx/e to /boot instead)<- New as of 04/08/2005
# date (check date or emerge sync and magic will fail)

Image

# emerge sync
# magic
# rm -v rootfs
(that big rootfs file, we don't need it now)
# mkdir /storage
# chmod a=rwx /storage


Image

Making it into a usable file server:
# emerge samba (install samba)
# emerge webmin (install webmin)
# rc-update add samba default (make samba run at boot)
# rc-update add webmin default (make webmin run at boot)
# ./etc/init.d/webmin start (start webmin)

If you get a file not found error when emerging, just search on Google for the file the run this command;
# cd /usr/portage/distfiles
# wget http://gd.tuwien.ac.at/graphics/libs/al ... 7.3.tar.gz <- Being the NEW url of the missing file
Then # emerge samba or what ever it was you where trying to install.


Now login to your xbox via the web https://pro:10000 and click yes,
User Name: root
Password: *what ever you changed it to*

Now click,
'Servers'(third in from the left at the top) then click,
'Samba Windows File Sharing' then click,
'Convert UNIX user to Samba user' then click,
'Convert Users'
then,
<- Return to share list (at the bottom)

At the top are some default shares, select them all in turn and delete them,
Then click 'Create a new file share'
Make the 'share name' Storage and the 'directory to share'/storage then click 'Create'
Then return to share list,
Now select your new share and click on 'security and access control'(for your share)
Under 'valid users'type gentoox and set Writable? to Yes then 'Save'

Go back to your console session and type,
# smbpasswd -a root (Make the password the same as above)
# smbpasswd -a gentoox (Make the password the same as above)

Now return to the main Samba windows file sharing screen and at the bottom should be a button saying 'Start samba servers' click it,

Now open up 'my computer' on your windows pc and type \\pro or \\ip_address_of_your_xbox in the address bar and hit return,

Hay presto you have created a Network Attached Storage (NAS) user name is gentoox and password is whatever you changed it to, tick the remember password. Then you can right click the storage folder and map it as a network drive and your all done.


Appendix A:

ADD A SECOND HARD DRIVE
To add a second hard drive simply remove the DVD Rom and install an additional hard drive in its place, you will also need to obtain a hard drive power splitter, then;

Image

Image

#cd /
#fdisk /dev/hdb


Image

Delete current disk configuration:
p (print the current hard drive layout)

Command (m for help): d
Partition number (1-4): 1 (keep deleting till all are gone)

Create New Data partition:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3876, default 1): (Hit Enter)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): (Hit Enter Again)

Typing w will then quit saving the config to disk.

Then format,
# mke2fs -j /dev/hdb1

Image

Then test mount the new drive,
#mkdir /storage2 && mount /dev/hdb1 /storage2
#chmod a=rwx /storage2
#ls -l /storage2


Image

If all is well you can go on and add it to your fstab so it will be seen at boot time,

#nano /etc/fstab
And add the line
/dev/hdb1 /storage2 ext3 defaults 0 1

Image

And then reboot to make sure it all comes up ok.

Then login to webmin and,
Then click 'Create a new file share'
Make the 'share name' Storage2 and the 'directory to share' /storage2 then click 'Create'
Then return to share list,
Now select your new share and click on 'security and access control'(for your share)
Under 'valid users' type gentoox and set Writable? to Yes then 'Save'

DONE!

Full credit to shallax, nobspangle, clpalmer, and any other contributors

Posted: Tue Jul 19, 2005 5:34 pm
by cheesyboofs
:arrow: BUMP Just ran Sparkle on it for shits and giggles it says found Native install/fixing but it didn't still does the same....

Posted: Wed Jul 20, 2005 9:47 am
by ShALLaX
The problem is the initrd. Try setting linuxboot.cfg to:

title Gentoox
kernel vmlinuz
initrd no
append blah blah blah

Posted: Wed Jul 20, 2005 4:49 pm
by cheesyboofs
Thanks for reply;

Right it gets further now but panics @:

# net 4: unix domain socket 1.0/SMP
# cranfs: wrong magic
# fatx: boot block signature not found. not fatx?
# sh-2021: reiserfs_read_super: can not find resierfs on ramdisk (1,0)
# kernel panic: VFS: unable to mount root fs on 01:00

As above the root fs on /dev/hda2 is formatted as ext3 but I did try Sparkle on it, could that have corrupted something?

hmmm...

Posted: Wed Jul 20, 2005 5:17 pm
by chrisb
Im listening with HUGE interest..

Posted: Wed Jul 20, 2005 9:30 pm
by ShALLaX
Try removing the "init=/linuxrc" part of the append line.

Posted: Wed Jul 20, 2005 10:19 pm
by cheesyboofs
I am SOOOO sorry to have wasted your time with this last bit;

append init=/linuxrc root=/dev/hda2 kbd-reset video=xboxfb:640x480,nohwcursor,hoc=13,voc=13

got changed to;

append init=/linuxrc root=/dev/ram0 kbd-reset video=xboxfb:640x480,nohwcursor,hoc=13,voc=13

when I re-copied it over trying to get it to work I didn't need to take 'init=/linuxrc' out.
It now boots sweet as a nut all 10Gb of it! I will give it ago again tomorrow from scratch to make sure the tutorial works and hopefully this will be the last 'Native' thred you get for a while :wink:

Well untill you release you own tru Pro 'Native' build CD ...

Posted: Wed Jul 20, 2005 10:34 pm
by ShALLaX
I was going to say "make sure its not booting to /dev/ram0 anymore"... at least you figured it out ;). Glad to see it's working!

Posted: Thu Jul 21, 2005 4:20 pm
by cheesyboofs
Just re-ran the tutorial from the top on a fresh blank 10Gb disk and it works a f**king treat, ran emerge sync and then magic all ran fine.
There is now no need to post native questions outside of this thread!

I will continue to tweak and refine the tutorial above but it does, and will work fine on a ‘whole’ stock hard drive and ‘anything’ bigger.

One question remaining is how can I tell that the new swap drive is being used, as there is no ‘swapinfo’ as there is under unix? Is it found and ‘used’ just because it is in the fstab?

Posted: Fri Jul 22, 2005 2:24 pm
by ShALLaX
`free`

Posted: Fri Jul 22, 2005 2:37 pm
by cheesyboofs
Ahh!

Pro root # free
total used free shared buffers cached
Mem: 58028 36060 21968 0 2240 22480
-/+ buffers/cache: 11340 46688
Swap: 250448 0 250448

Ta!

Top nice...

Posted: Wed Jul 27, 2005 6:06 am
by chrisb
It works..

I followed the guide, I even changed the swap size to 1gb, and it worked..
So the native installer has been done easy..

I bow down in the dust.. :D

Thx guys..

And Shallax, Why dont you make this topic a sticky??

Posted: Wed Jul 27, 2005 2:28 pm
by ShALLaX
Youll never use 1gb of swap, btw.

*Stuck*

Posted: Fri Sep 09, 2005 10:52 pm
by ShALLaX
I dare say you could use Resctoox instead of Xebian to do all of this - that way you'd have reiserfs support!

Posted: Mon Sep 12, 2005 5:59 pm
by cheesyboofs
I tried to use the Resctoox CD on my new 200Gb drive but I get this when I try to format the partitions;

Code: Select all

Command (m for help): p

Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1               1          32      257008+  82  Linux swap
/dev/hda2   *          33       24792   198884700   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
Resctoox:> mkreiserfs /dev/hda2

<-------------mkreiserfs, 2002------------->
reiserfsprogs 3.6.4

stat failed: No such file or directory
Resctoox:> mke2fs -j /dev/hda2
mke2fs: error while loading shared libraries: libblkid.so.1: cannot open shared object file: No such file or directory
Resctoox:> mkswap /dev/hda1
mkswap: /dev/hda1: No such file or directory
Resctoox:>