xboxscene.org forums

Author Topic: Required Options For Compiling Kernel  (Read 59 times)

friedgold

  • Archived User
  • Sr. Member
  • *
  • Posts: 266
Required Options For Compiling Kernel
« on: February 14, 2006, 06:41:00 PM »

Try looking at this guide for compiling a kernel with the Xbox-Linux patches:

http://cvs.xbox-linu...box?view=markup

For building a 'from scratch' Linux system which is as small as possible you might want to take a look at buildroot as it simplifies the process somewhat.

I put together a small Linux system with a xpad + usb keyboard drivers, a basic menu system based around dialog and a ftp server using buildroot a few months ago which hasn't yet seen the light of day (it was built to be used with OpenDash to give it a ftp server). The kernel and initrd together take up 1.3MB. If you think it would help I can make that available along with the kernel config, busybox config and buildroot config and some patches I used.

Also are you aware of xmugen?
Logged

x-fox

  • Archived User
  • Jr. Member
  • *
  • Posts: 83
Required Options For Compiling Kernel
« Reply #1 on: February 15, 2006, 06:07:00 PM »

QUOTE(friedgold @ Feb 15 2006, 03:48 AM) View Post

Try looking at this guide for compiling a kernel with the Xbox-Linux patches:

http://cvs.xbox-linu...box?view=markup

For building a 'from scratch' Linux system which is as small as possible you might want to take a look at buildroot as it simplifies the process somewhat.

I put together a small Linux system with a xpad + usb keyboard drivers, a basic menu system based around dialog and a ftp server using buildroot a few months ago which hasn't yet seen the light of day (it was built to be used with OpenDash to give it a ftp server). The kernel and initrd together take up 1.3MB. If you think it would help I can make that available along with the kernel config, busybox config and buildroot config and some patches I used.

Also are you aware of xmugen?


Hi friedgold, any chance you could send the small Linux system to my googlemail address.
Logged

friedgold

  • Archived User
  • Sr. Member
  • *
  • Posts: 266
Required Options For Compiling Kernel
« Reply #2 on: February 16, 2006, 10:19:00 AM »

QUOTE(x-fox @ Feb 16 2006, 01:14 AM) View Post

Hi friedgold, any chance you could send the small Linux system to my googlemail address.

I've just made it available to download. There are various configuration files / patches in the src directory when you unzip which you may find useful if you want to modify / rebuild it. Read the README for an overview. I'd be intrested to hear if anyone makes use of it, especially if they make any improvements.
Logged

x-fox

  • Archived User
  • Jr. Member
  • *
  • Posts: 83
Required Options For Compiling Kernel
« Reply #3 on: February 16, 2006, 06:13:00 PM »

cheers friedgold. I look forward to playing with it. The minilinux I mean biggrin.gif
Logged

x-fox

  • Archived User
  • Jr. Member
  • *
  • Posts: 83
Required Options For Compiling Kernel
« Reply #4 on: February 16, 2006, 06:39:00 PM »

Cant seem to get it to boot. maybe doing something wrong. I copied all the files except src dir to the root of my e drive clicked on default.xbe. I get the loading linux 2.4 screen then a garbled screen. Any ideas anyone
Logged

x-fox

  • Archived User
  • Jr. Member
  • *
  • Posts: 83
Required Options For Compiling Kernel
« Reply #5 on: February 16, 2006, 07:03:00 PM »

figured it out. just rename initrd.7z to initrd. how stupid am I
Logged

x-fox

  • Archived User
  • Jr. Member
  • *
  • Posts: 83
Required Options For Compiling Kernel
« Reply #6 on: February 16, 2006, 08:23:00 PM »

does anyone know the command to decompress then compress the initrd.7z.
I have installed p7zip using apt-get so I presume I have the right tool
Logged

friedgold

  • Archived User
  • Sr. Member
  • *
  • Posts: 266
Required Options For Compiling Kernel
« Reply #7 on: February 17, 2006, 03:30:00 AM »

I used the LZMA Encoder/Decoder which is part of the LZMA SDK.

(http://www.7-zip.org/sdk.html

Have a look at this README (it should also be include in the zip under the src dir if I remember correctly).

http://www.zelow.no/...zmastuff/README
Logged

x-fox

  • Archived User
  • Jr. Member
  • *
  • Posts: 83
Required Options For Compiling Kernel
« Reply #8 on: February 17, 2006, 04:26:00 PM »

Nice little linux friedgold. I cant seem to make head or tail of the instructions to decompress the initrd.7z so I can play about with the contents and recompess it.Would yo mind giving a short tut to do the following:

decompress the initrd.7z
mount the decompresed initrd.7z to view and work with the contents
recompress the initrd.7z

As you might have guessed my linux knowlege is rather limited. I just tend to hack away at stuff. but I figure using your little linux might be a way of understanding how linux works
Logged

friedgold

  • Archived User
  • Sr. Member
  • *
  • Posts: 266
Required Options For Compiling Kernel
« Reply #9 on: February 17, 2006, 05:53:00 PM »

The first thing you need to do is download the LZMA lzma compressor/decompressor which is part of the LZMA SDK.

http://prdownloads.s...ar.bz2?download

Then follow the steps in the link I posted to compile and install the compressor/decompressor.

CODE
mkdir lzma
cd lzma
tar xvjf ../lzma432.tar.bz2
cd SRC/7zip/Compress/LZMA_Alone
dos2unix makefile
make


This should give you a executable called lzma. Copy this somewhere in your path (I copied it to /usr/local/bin).

Then to decompress the initrd.7z, saving the result as initrd:

CODE
lzma d initrd.7z initrd


Then to mount the initrd and make changes use:

CODE
mkdir loop
mount -o loop -t ext2 initrd loop


This should mount the initrd in the loop directory. You can then look at / edit the contents by manipulating the files in the loop directory. When you are done unmount this directory (umount loop).

Finally to recompress the initrd use:

CODE
lzma e initrd initrd.7z -d16


The actual script I use to create the image is below. It's slightly different to the procedure outlined above because
1) I already have the contents of the initrd in a directory (called source).
2) I recreate the initrd image each time from the source directory rather than editing the exiting one. This is to make sure no space is wasted.

CODE
#!/bin/sh
# Make a blank image
dd if=/dev/zero of=initrd bs=1024k count=4

# Format image as ext2
mke2fs -F -N 8192 -m0 -b 1024 initrd

# Mount ext2 image
mkdir loop
mount -t ext2 -o loop initrd loop

# Copy source files to ext2 image
cp -a source/* loop
umount initrd
rm -r loop

# Compress ext2 image using lzma
lzma e initrd initrd.7z -d16

# Cleanup
rm initrd


Because dealing with lzma compressed files is a bit of a hassle I've uploaded also gzip'd version of the ext2 initrd. The contents are exactly the same, the only difference is the compression method. You might find it easier to modify this since you don't need to install the LZMA SDK.
Logged

x-fox

  • Archived User
  • Jr. Member
  • *
  • Posts: 83
Required Options For Compiling Kernel
« Reply #10 on: February 17, 2006, 06:28:00 PM »

thanks friedgold you are the man
Logged