NSLU2-Linux
view · edit · print · history

Debian.BuildImage History

Hide minor edits - Show changes to markup

November 15, 2008, at 09:50 PM by dumfrac -- Add section on make-kpkg
Changed lines 104-109 from:

Building the kernel

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
to:

Customizing and building the kernel

From this point on, the instructions are the same. There are three methods for customizing and building the kernel presented here. The first is completely manual, the second uses make menuconfig and friends, and the third uses make-kpkg.

Manually customize and build the kernel
Changed lines 144-145 from:

Either method above will result in a Debian package in the directory above the current directory, e.g.

to:
Using make-kpkg
Changed lines 149-154 from:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

to:

apt-get source linux-2.6 cp /boot/config-2.6.26-1-ixp4xx .config (in kernel source root) make ARCH=arm oldconfig or make ARCH=arm silentoldconfig make-kpkg --rootcmd=fakeroot --revision=0 --append-to-version=-custom --arch=armel --cross-compile=/usr/bin/arm-linux-gnueabi- kernel-image --initrd

Changed lines 158-167 from:

Copy the .deb file to the slug and install the package: dpkg -i pkgname.deb

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Other useful documents are http://people.debian.org/~fjp/talks/debconf6/paper/ and http://kitenet.net/~joey/blog/entry/my_debian-installer_test_methods.html.

Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

Here are some preliminary instructions on building a Debian installer image for the NSLU2. They are a bit cryptic because they are pretty much a dump of my notes. I will get round to polishing them soon.

to:

Installing the kernel

The methods above will result in a Debian package in the directory above the current directory, e.g.

Added lines 164-180:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb @] (:tableend:)

Copy the .deb file to the NSLU2 and install the package: dpkg -i pkgname.deb

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Other useful documents are http://people.debian.org/~fjp/talks/debconf6/paper/ and http://kitenet.net/~joey/blog/entry/my_debian-installer_test_methods.html.

Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

Here are some preliminary instructions on building a Debian installer image for the NSLU2. They are a bit cryptic because they are pretty much a dump of my notes. I will get round to polishing them soon.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:) [@

November 15, 2008, at 09:38 PM by dumfrac -- Update link
Changed line 18 from:

emDebian has been developed specifically for this purpose, and apparently works well these days. To use emDebian, add

to:

emDebian has been developed specifically for this purpose, and apparently works well these days. To use emDebian, add

November 15, 2008, at 09:26 PM by dumfrac --
Changed lines 35-36 from:

This procedure works for etch - I have not got it working for lenny yet.

to:

(This procedure works for etch - I have not got it working for lenny yet.)

November 15, 2008, at 09:26 PM by dumfrac -- Fix formatting
Changed lines 16-18 from:

I haven't tested this on lenny, only in a sid chroot. emDebian has been developed specifically for this purpose, and apparently works well these days. To use emDebian, add

to:

(I haven't tested this on lenny, only in a sid chroot.)

emDebian has been developed specifically for this purpose, and apparently works well these days. To use emDebian, add

Changed lines 35-36 from:

This procedure works for etch - I have not got it working for lenny yet. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great!

to:

This procedure works for etch - I have not got it working for lenny yet.

You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great!

November 15, 2008, at 09:22 PM by dumfrac -- Fix formatting
Changed line 16 from:

I haven't tested this on lenny, only in a sid chroot. emDebian has been developed specifically for this purpose, and apparently works well these days. To use emDebian, add

to:

I haven't tested this on lenny, only in a sid chroot. emDebian has been developed specifically for this purpose, and apparently works well these days. To use emDebian, add

Changed lines 33-34 from:

This procedure works for etch - I have not got it working for lenny yet. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great!

to:

This procedure works for etch - I have not got it working for lenny yet. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great!

November 15, 2008, at 09:21 PM by dumfrac -- Updates
Changed lines 3-4 from:

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

to:

Debian developers, please flesh out this page. We want this page to be instructions for experienced NSLU2-Linux developers to build the absolute latest Debian packages, kernel and installer for the NSLU2-Linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

Changed lines 10-24 from:

Instructions for building the Debian kernel

The Debian Linux Kernel Handbook is a good resource if you get stuck.

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great !

You can also compile yourself a cross-compilation toolchain for arm by using crosstool 0.43. It take about 1 hour on a intel P4 2.6 Ghz. When you have done, don't forget to add your new cross-compilation toolchain into your path.

This section uses 2.6.18 as an example, because it was the latest kernel version at the time of writing. The instructions for building the kernel depend on whether the source is obtained from the subversion respository or from a released version of a Debian kernel.

Source code from the Debian subversion repository

The example used here checks out the trunk version of the Debian kernel support code from the Debian repository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), and change directories to your new directory. Download the appropriate kernel source tarball from the Debian Build Server and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version.

to:

Cross-compilation toolchain

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. A cross-compilation toolchain is recommended because compilation of the kernel on the NSLU2 will take many many hours. There are three options listed here for obtaining a cross-compilation toolchain.

emDebian

I haven't tested this on lenny, only in a sid chroot. emDebian has been developed specifically for this purpose, and apparently works well these days. To use emDebian, add

Changed lines 20-23 from:

$ mkdir ~/src $ cd ~/src $ wget http://kernel-archive.buildserver.net/debian-kernel/pool/main/l/linux-2.6/linux-2.6_2.6.20.orig.tar.gz $ tar xzvf linux-2.6_2.6.20.orig.tar.gz

to:

deb http://www.emdebian.org/debian/ unstable main

Changed lines 23-24 from:

Change directories to the Linux Kernel source directory, and check out the Debian Linux kernel support source tree from the subversion repository

to:

and install the cross-compilation toolchain (example for armel shown)

Changed lines 27-28 from:

$ cd linux-2.6-2.6.20 $ svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian debian

to:

apt-get install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi gcc-4.1-arm-linux-gnueabi

Changed lines 31-49 from:

Install the build-dependencies for the linux-2.6 package.

to:

Create your own cross-compilation toolchain

This procedure works for etch - I have not got it working for lenny yet. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great!

crosstool

You can also compile yourself a cross-compilation toolchain for arm by using crosstool 0.43. It take about 1 hour on a intel P4 2.6 Ghz. When you have done, don't forget to add your new cross-compilation toolchain into your path.

Instructions for building the Debian kernel

The Debian Linux Kernel Handbook is a good resource if you get stuck.

This section uses 2.6.18 as an example, because it was the latest kernel version at the time of writing. The instructions for building the kernel depend on whether the source is obtained from the subversion repository or from a released version of a Debian kernel.

Source code from the Debian subversion repository

The example used here checks out the trunk version of the Debian kernel support code from the Debian repository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), and change directories to your new directory. Download the appropriate kernel source tar ball from the Debian Build Server and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version.

Changed lines 53-56 from:

$ sudo apt-get build-dep linux-2.6

to:

$ mkdir ~/src $ cd ~/src $ wget http://kernel-archive.buildserver.net/debian-kernel/pool/main/l/linux-2.6/linux-2.6_2.6.20.orig.tar.gz $ tar xzvf linux-2.6_2.6.20.orig.tar.gz

Changed lines 60-62 from:

Source code from a released Debian kernel

To download the source code for the latest kernel for a distribution (e.g. stable, testing, or unstable) either use apt-get, e.g.

to:

Change directories to the Linux Kernel source directory, and check out the Debian Linux kernel support source tree from the subversion repository

Changed lines 64-65 from:

$ apt-get -t [stable | testing | unstable] source linux-2.6

to:

$ cd linux-2.6-2.6.20 $ svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian debian

Changed lines 68-69 from:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian linux-source package page and unpack the source using dpkg, e.g.

to:

Install the build-dependencies for the linux-2.6 package.

Changed lines 73-77 from:

$ wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.dsc http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz $ dpkg-source -x linux-2.6_2.6.18-6.dsc linux-2.6.18-6 $ cd linux-2.6.18-6

to:

$ sudo apt-get build-dep linux-2.6

Changed lines 77-88 from:

You can also checkout a released version of the Debian kernel from the subversion repository by finding the revision number of the version using the checkin comments at http://svn.debian.org/wsvn/kernel. If you do this, then follow the instructions for setting up the build environment in "Source code from the Debian subversion repository" above.

Building the kernel

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel source revision number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+', and to disable a patch, preceed the atch file name with a '-'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the Debian make files. For example, to compile the arm ixp4xx kernel, do

to:

Source code from a released Debian kernel

To download the source code for the latest kernel for a distribution (e.g. stable, testing, or unstable) either use apt-get, e.g.

Changed lines 83-87 from:

$ cd ~/src/linux-2.6-2.6.18 $ fakeroot debian/rules clean $ fakeroot debian/rules debian/control $ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

to:

$ apt-get -t [stable | testing | unstable] source linux-2.6

Changed lines 86-90 from:

For other makefile targets, look in debian/rules.gen. The list of currently supported flavours for arm can be found in debian/arch/arm/defines.

Using make menuconfig to customize the kernel

Another way of customizing the kernel configuration is to use the setup build rules, and make menuconfig and friends.

to:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian linux-source package page and unpack the source using dpkg, e.g.

Changed lines 90-98 from:

$ cd ~/src/linux-2.6-2.6.18 $ fakeroot debian/rules clean $ fakeroot debian/rules debian/control $ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen setup-arm-none-ixp4xx >> ../kernel-build.log 2>&1 $ cd debian/build/build-arm-none-ixp4xx/ $ make ARCH=arm menuconfig $ cd ../../.. $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

to:

$ wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.dsc http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz $ dpkg-source -x linux-2.6_2.6.18-6.dsc linux-2.6.18-6 $ cd linux-2.6.18-6

Changed lines 98-109 from:

Either method above will result in a Debian package in the directory above the current directory, e.g.

to:

You can also checkout a released version of the Debian kernel from the subversion repository by finding the revision number of the version using the checkin comments at http://svn.debian.org/wsvn/kernel. If you do this, then follow the instructions for setting up the build environment in "Source code from the Debian subversion repository" above.

Building the kernel

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
  • The kernel defconfig files are under debian/arch and are organized by architecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controlled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel source revision number, and the patches in these files are applied in the order listed. To enable a patch, precede the patch file name with a '+', and to disable a patch, precede the patch file name with a '-'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the Debian make files. For example, to compile the arm ixp4xx kernel, do

Changed lines 113-117 from:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

to:

$ cd ~/src/linux-2.6-2.6.18 $ fakeroot debian/rules clean $ fakeroot debian/rules debian/control $ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

Changed lines 120-122 from:

(It should be possible to compile the kernel using make-kpkg, something like this:

to:

For other makefile targets, look in debian/rules.gen. The list of currently supported flavours for arm can be found in debian/arch/arm/defines.

Using make menuconfig to customize the kernel

Another way of customizing the kernel configuration is to use the setup build rules, and make menuconfig and friends.

Changed lines 128-136 from:

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

to:

$ cd ~/src/linux-2.6-2.6.18 $ fakeroot debian/rules clean $ fakeroot debian/rules debian/control $ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen setup-arm-none-ixp4xx >> ../kernel-build.log 2>&1 $ cd debian/build/build-arm-none-ixp4xx/ $ make ARCH=arm menuconfig $ cd ../../.. $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

Changed lines 140-141 from:

but I have not got this to work - any suggestions?)

to:

Either method above will result in a Debian package in the directory above the current directory, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

(:tableend:)

October 10, 2008, at 09:15 AM by pembo -- Removed spam
Deleted line 0:

18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615

October 10, 2008, at 03:11 AM by httpfreewebtowncomlorindagaiertopic1975htm -- http://freewebtown.com/lorindagaier/topic1975.htm
Added line 1:

18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615

October 08, 2008, at 04:29 PM by ByronT -- Remove Spam
Deleted line 0:

4294967295 4294967295 4294967295 4294967295 4294967295

October 08, 2008, at 12:01 PM by httplizziesilverberiespanaescomment-518htm -- http://lizziesilverber.iespana.es/comment-518.htm
Added line 1:

4294967295 4294967295 4294967295 4294967295 4294967295

October 07, 2008, at 07:46 PM by fcarolo -- undid vandalism
Deleted line 0:

18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615

October 04, 2008, at 05:40 AM by httpfreewebtowncomrositaskipworthmovie-at-crown-pointhtm -- http://freewebtown.com/rositaskipworth/movie-at-crown-point.htm
Added line 1:

18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615

October 01, 2008, at 08:19 PM by slugmanbashi -- undid spam
Deleted line 0:

18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615

October 01, 2008, at 11:55 AM by httpgeorgiannamansfibelgiquecomarticle848htm -- http://georgiannamansf.ibelgique.com/article848.htm
Added line 1:

18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615

September 22, 2008, at 08:40 PM by fcarolo --
Deleted line 0:

lavarlilire

September 22, 2008, at 12:08 PM by aceldarc -- aceldarc
September 22, 2008, at 12:08 PM by aceldarc -- aceldarc
Added line 1:

lavarlilire

September 04, 2008, at 04:36 AM by dumfrac -- Update padded initramfs size
Changed line 235 from:

Pad to 4 MB and endian swap the new ramdisk

to:

Pad to 6291440 bytes (6*1024*1024 - 16) and endian swap the new ramdisk

Changed line 239 from:

$ dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync

to:

$ dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=6291440 conv=sync

Changed lines 330-331 from:
  1. pad to 4M and byte swap

dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync

to:
  1. pad to 6*1024*1024 - 16 bytes and byte swap

dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=6291440 conv=sync

September 04, 2008, at 04:25 AM by dumfrac -- Remove spam
Deleted line 0:

trmonv

July 11, 2008, at 07:31 AM by racdeltr -- racdeltr
Added line 1:

trmonv

December 16, 2007, at 12:48 PM by landrash -- Restore after defaced
Changed lines 1-339 from:

zrevrmv53hy58tq bad credit private student loans bad credit private student loans

to:

How to build a new Debian/NSLU2 image

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

General Notes

  • The instructions on this page assume that you are running Debian on your build machine.
  • These instructions are currently preliminary - this wiki page is a work in progress (as are all wiki pages by definition).

Instructions for building the Debian kernel

The Debian Linux Kernel Handbook is a good resource if you get stuck.

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great !

You can also compile yourself a cross-compilation toolchain for arm by using crosstool 0.43. It take about 1 hour on a intel P4 2.6 Ghz. When you have done, don't forget to add your new cross-compilation toolchain into your path.

This section uses 2.6.18 as an example, because it was the latest kernel version at the time of writing. The instructions for building the kernel depend on whether the source is obtained from the subversion respository or from a released version of a Debian kernel.

Source code from the Debian subversion repository

The example used here checks out the trunk version of the Debian kernel support code from the Debian repository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), and change directories to your new directory. Download the appropriate kernel source tarball from the Debian Build Server and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ mkdir ~/src
$ cd ~/src
$ wget http://kernel-archive.buildserver.net/debian-kernel/pool/main/l/linux-2.6/linux-2.6_2.6.20.orig.tar.gz
$ tar xzvf linux-2.6_2.6.20.orig.tar.gz

(:tableend:)

Change directories to the Linux Kernel source directory, and check out the Debian Linux kernel support source tree from the subversion repository (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd linux-2.6-2.6.20
$ svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian debian

(:tableend:)

Install the build-dependencies for the linux-2.6 package. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ sudo apt-get build-dep linux-2.6

(:tableend:)

Source code from a released Debian kernel

To download the source code for the latest kernel for a distribution (e.g. stable, testing, or unstable) either use apt-get, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ apt-get -t [stable | testing | unstable] source linux-2.6

(:tableend:) or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian linux-source package page and unpack the source using dpkg, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.dsc \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz
$ dpkg-source -x linux-2.6_2.6.18-6.dsc linux-2.6.18-6
$ cd linux-2.6.18-6

(:tableend:)

You can also checkout a released version of the Debian kernel from the subversion repository by finding the revision number of the version using the checkin comments at http://svn.debian.org/wsvn/kernel. If you do this, then follow the instructions for setting up the build environment in "Source code from the Debian subversion repository" above.

Building the kernel

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel source revision number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+', and to disable a patch, preceed the atch file name with a '-'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the Debian make files. For example, to compile the arm ixp4xx kernel, do (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:) For other makefile targets, look in debian/rules.gen. The list of currently supported flavours for arm can be found in debian/arch/arm/defines.

Using make menuconfig to customize the kernel

Another way of customizing the kernel configuration is to use the setup build rules, and make menuconfig and friends. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen setup-arm-none-ixp4xx >> ../kernel-build.log 2>&1
$ cd debian/build/build-arm-none-ixp4xx/
$ make ARCH=arm menuconfig
$ cd ../../..
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:)

Either method above will result in a Debian package in the directory above the current directory, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

(:tableend:)

(It should be possible to compile the kernel using make-kpkg, something like this:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

(:tableend:)

but I have not got this to work - any suggestions?)

Copy the .deb file to the slug and install the package: dpkg -i pkgname.deb

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Other useful documents are http://people.debian.org/~fjp/talks/debconf6/paper/ and http://kitenet.net/~joey/blog/entry/my_debian-installer_test_methods.html.

Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

Here are some preliminary instructions on building a Debian installer image for the NSLU2. They are a bit cryptic because they are pretty much a dump of my notes. I will get round to polishing them soon.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

Build and install the kernel that you want use with the installer

Build udebs...
Download linux-kernel-di-arm-2.6.dsc and linux-kernel-di-arm-2.6.tar.gz
apt-get install kernel-wedge fakeroot gcc
dpkg-source -x linux-kernel-di-arm-2.6_1.7.dsc
cd linux-kernel-di-arm-2.6-1.7/
vi kernel-versions
Remove all kernel versions except flavour ixp4xx
Change kernel version to the version desired/built
dpkg-buildpackage -rfakeroot -d -b
-d ignores unmet build-depends (required if you are changing the version of the kernel used)

Build the installer image...
apt-get source debian-installer or check out a copy from the subversion repository
cd debian-installer-yyyymmdd or installer
cp ../*.udeb build/localudebs/

Edit build/config/arm.cfg

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with 
the installer doesn't match the version of the kernel in testing/unstable
ext3-modules-${kernel:Version}
md-modules-${kernel:Version}
nic-modules-${kernel:Version}
scsi-core-modules-${kernel:Version}
usb-storage-modules-${kernel:Version}

sudo apt-get build-dep debian-installer

fakeroot make build_ixp4xx_netboot

The image will be in build/dest/ixp4xx/netboot and will be called di-nslu2.bin

(:tableend:)

Modify an existing installer image initramfs

Rather than building the install image yourself, depending on what you want to do, it may be easier to use an existing image and modify the initramfs. To do this, follow these instructions.

Unpack the image with slugimage (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -u -i di-nslu2.bin

(:tableend:)

Endian swap the init ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

(:tableend:)

Unpack the ramdisk as root (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ su -c 'mkdir initrd'
$ cd initrd
$ su -c 'zcat ../ramdisk-swap.gz | cpio -i'

(:tableend:)

Modify the ramdisk in the way that you want. NB, make all of your changes as root. For instance, to copy the NPE-B microcode to the ramdisk you would do (1/12/2007 These instruction are obsolete, but still work.) (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd initrd
$ cd lib
$ su -c 'mkdir firmware'
$ cd firmware
$ su -c 'cp <path to microcode>/NPE-B.01000201 .'
$ su -c 'ln -s NPE-B.01000201 NPE-B'

(:tableend:)

Then regenerate the ramdisk. Run the following commands in the root directory of the ramdisk. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
$ cd ..

(:tableend:)

Pad to 4 MB and endian swap the new ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
$ devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

(:tableend:)

Create new di image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin
$ sudo upslug2 -i di-nslu2-new.bin

(:tableend:)

Note: If you are building your own kernel, you must byte-swap it too before using it with slugimage: (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< vmlinuz; xp $ 4' > vmlinuz-swap

(:tableend:)

Adding NPE driver to an existing Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. Thus the NPE driver is not included in the official Debian installer image. This section documents the procedure to add the driver and microcode to an existing Debian Installer image so that you don't have to use a USB to Ethernet adapter to install Debian.

You need to manually download the nic-modules-....udeb and unpack it. It can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version name used in the script may be out of date). You will also need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. Alternatively, follow the instructions from the accesslib README. You can extract it by following the script below up to the 'add firmware' section. Place the NPE microcode, nic-modules-....udeb and the di-nslu2.bin in a directory, cd to that directory and run the script below.

Also, because depmod is not run afterwards, you need to add a script that manually loads the module. Something like:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch
cat > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

depmod
modprobe ixp4xx_mac || true
^D

chmod +x lib/debian-installer-startup.d/S05ixp400

(:tableend:)

Putting all of the above together, a script can be created to add the firmware and nic modules to a nightly build of the debian-installer

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

#!/bin/bash
set -e

# unpack the firmware
mkdir di-unpack
cd di-unpack
slugimage -u -i ../$1
devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

#unpack the initramfs
mkdir initrd
cd initrd
zcat ../ramdisk-swap.gz | cpio -i

#add the npe modules
dpkg-deb -x ../../nic-modules-2.6.18-4-ixp4xx-di_1.8_arm.udeb .

#add the firmware
mkdir lib/firmware
cp ../../NPE-B.01000201 lib/firmware/
cd lib/firmware
#make link in firmware dir
ln -s NPE-B.01000201 NPE-B
cd ../..

#update module dependencies
depmod -b `pwd` 2.6.18-4-ixp4xx

#ensure the driver gets loaded
cat <<EOF > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

modprobe ixp4xx_mac || true

EOF
chmod 0755 lib/debian-installer-startup.d/S05ixp400

# build a new initramfs
find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
cd ..

# pad to 4M and byte swap
dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

# build new firmware
slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o ../di-nslu2-ixp4xx_npe.bin

(:tableend:)

Copy the above into a file (e.g. add_npe_driver.sh) and run as root with bash ./add_npe_driver.sh di-nslu2.bin. This will create the modified image in di-nslu2-ixp4xx_npe.bin

December 16, 2007, at 08:21 AM by bad credit private student loans -- http://bad-credit-private-student-loans.ceroline.info/
Changed lines 1-339 from:

How to build a new Debian/NSLU2 image

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

General Notes

  • The instructions on this page assume that you are running Debian on your build machine.
  • These instructions are currently preliminary - this wiki page is a work in progress (as are all wiki pages by definition).

Instructions for building the Debian kernel

The Debian Linux Kernel Handbook is a good resource if you get stuck.

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great !

You can also compile yourself a cross-compilation toolchain for arm by using crosstool 0.43. It take about 1 hour on a intel P4 2.6 Ghz. When you have done, don't forget to add your new cross-compilation toolchain into your path.

This section uses 2.6.18 as an example, because it was the latest kernel version at the time of writing. The instructions for building the kernel depend on whether the source is obtained from the subversion respository or from a released version of a Debian kernel.

Source code from the Debian subversion repository

The example used here checks out the trunk version of the Debian kernel support code from the Debian repository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), and change directories to your new directory. Download the appropriate kernel source tarball from the Debian Build Server and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ mkdir ~/src
$ cd ~/src
$ wget http://kernel-archive.buildserver.net/debian-kernel/pool/main/l/linux-2.6/linux-2.6_2.6.20.orig.tar.gz
$ tar xzvf linux-2.6_2.6.20.orig.tar.gz

(:tableend:)

Change directories to the Linux Kernel source directory, and check out the Debian Linux kernel support source tree from the subversion repository (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd linux-2.6-2.6.20
$ svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian debian

(:tableend:)

Install the build-dependencies for the linux-2.6 package. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ sudo apt-get build-dep linux-2.6

(:tableend:)

Source code from a released Debian kernel

To download the source code for the latest kernel for a distribution (e.g. stable, testing, or unstable) either use apt-get, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ apt-get -t [stable | testing | unstable] source linux-2.6

(:tableend:) or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian linux-source package page and unpack the source using dpkg, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.dsc \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz
$ dpkg-source -x linux-2.6_2.6.18-6.dsc linux-2.6.18-6
$ cd linux-2.6.18-6

(:tableend:)

You can also checkout a released version of the Debian kernel from the subversion repository by finding the revision number of the version using the checkin comments at http://svn.debian.org/wsvn/kernel. If you do this, then follow the instructions for setting up the build environment in "Source code from the Debian subversion repository" above.

Building the kernel

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel source revision number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+', and to disable a patch, preceed the atch file name with a '-'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the Debian make files. For example, to compile the arm ixp4xx kernel, do (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:) For other makefile targets, look in debian/rules.gen. The list of currently supported flavours for arm can be found in debian/arch/arm/defines.

Using make menuconfig to customize the kernel

Another way of customizing the kernel configuration is to use the setup build rules, and make menuconfig and friends. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen setup-arm-none-ixp4xx >> ../kernel-build.log 2>&1
$ cd debian/build/build-arm-none-ixp4xx/
$ make ARCH=arm menuconfig
$ cd ../../..
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:)

Either method above will result in a Debian package in the directory above the current directory, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

(:tableend:)

(It should be possible to compile the kernel using make-kpkg, something like this:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

(:tableend:)

but I have not got this to work - any suggestions?)

Copy the .deb file to the slug and install the package: dpkg -i pkgname.deb

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Other useful documents are http://people.debian.org/~fjp/talks/debconf6/paper/ and http://kitenet.net/~joey/blog/entry/my_debian-installer_test_methods.html.

Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

Here are some preliminary instructions on building a Debian installer image for the NSLU2. They are a bit cryptic because they are pretty much a dump of my notes. I will get round to polishing them soon.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

Build and install the kernel that you want use with the installer

Build udebs...
Download linux-kernel-di-arm-2.6.dsc and linux-kernel-di-arm-2.6.tar.gz
apt-get install kernel-wedge fakeroot gcc
dpkg-source -x linux-kernel-di-arm-2.6_1.7.dsc
cd linux-kernel-di-arm-2.6-1.7/
vi kernel-versions
Remove all kernel versions except flavour ixp4xx
Change kernel version to the version desired/built
dpkg-buildpackage -rfakeroot -d -b
-d ignores unmet build-depends (required if you are changing the version of the kernel used)

Build the installer image...
apt-get source debian-installer or check out a copy from the subversion repository
cd debian-installer-yyyymmdd or installer
cp ../*.udeb build/localudebs/

Edit build/config/arm.cfg

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with 
the installer doesn't match the version of the kernel in testing/unstable
ext3-modules-${kernel:Version}
md-modules-${kernel:Version}
nic-modules-${kernel:Version}
scsi-core-modules-${kernel:Version}
usb-storage-modules-${kernel:Version}

sudo apt-get build-dep debian-installer

fakeroot make build_ixp4xx_netboot

The image will be in build/dest/ixp4xx/netboot and will be called di-nslu2.bin

(:tableend:)

Modify an existing installer image initramfs

Rather than building the install image yourself, depending on what you want to do, it may be easier to use an existing image and modify the initramfs. To do this, follow these instructions.

Unpack the image with slugimage (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -u -i di-nslu2.bin

(:tableend:)

Endian swap the init ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

(:tableend:)

Unpack the ramdisk as root (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ su -c 'mkdir initrd'
$ cd initrd
$ su -c 'zcat ../ramdisk-swap.gz | cpio -i'

(:tableend:)

Modify the ramdisk in the way that you want. NB, make all of your changes as root. For instance, to copy the NPE-B microcode to the ramdisk you would do (1/12/2007 These instruction are obsolete, but still work.) (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd initrd
$ cd lib
$ su -c 'mkdir firmware'
$ cd firmware
$ su -c 'cp <path to microcode>/NPE-B.01000201 .'
$ su -c 'ln -s NPE-B.01000201 NPE-B'

(:tableend:)

Then regenerate the ramdisk. Run the following commands in the root directory of the ramdisk. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
$ cd ..

(:tableend:)

Pad to 4 MB and endian swap the new ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
$ devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

(:tableend:)

Create new di image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin
$ sudo upslug2 -i di-nslu2-new.bin

(:tableend:)

Note: If you are building your own kernel, you must byte-swap it too before using it with slugimage: (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< vmlinuz; xp $ 4' > vmlinuz-swap

(:tableend:)

Adding NPE driver to an existing Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. Thus the NPE driver is not included in the official Debian installer image. This section documents the procedure to add the driver and microcode to an existing Debian Installer image so that you don't have to use a USB to Ethernet adapter to install Debian.

You need to manually download the nic-modules-....udeb and unpack it. It can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version name used in the script may be out of date). You will also need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. Alternatively, follow the instructions from the accesslib README. You can extract it by following the script below up to the 'add firmware' section. Place the NPE microcode, nic-modules-....udeb and the di-nslu2.bin in a directory, cd to that directory and run the script below.

Also, because depmod is not run afterwards, you need to add a script that manually loads the module. Something like:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch
cat > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

depmod
modprobe ixp4xx_mac || true
^D

chmod +x lib/debian-installer-startup.d/S05ixp400

(:tableend:)

Putting all of the above together, a script can be created to add the firmware and nic modules to a nightly build of the debian-installer

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

#!/bin/bash
set -e

# unpack the firmware
mkdir di-unpack
cd di-unpack
slugimage -u -i ../$1
devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

#unpack the initramfs
mkdir initrd
cd initrd
zcat ../ramdisk-swap.gz | cpio -i

#add the npe modules
dpkg-deb -x ../../nic-modules-2.6.18-4-ixp4xx-di_1.8_arm.udeb .

#add the firmware
mkdir lib/firmware
cp ../../NPE-B.01000201 lib/firmware/
cd lib/firmware
#make link in firmware dir
ln -s NPE-B.01000201 NPE-B
cd ../..

#update module dependencies
depmod -b `pwd` 2.6.18-4-ixp4xx

#ensure the driver gets loaded
cat <<EOF > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

modprobe ixp4xx_mac || true

EOF
chmod 0755 lib/debian-installer-startup.d/S05ixp400

# build a new initramfs
find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
cd ..

# pad to 4M and byte swap
dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

# build new firmware
slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o ../di-nslu2-ixp4xx_npe.bin

(:tableend:)

Copy the above into a file (e.g. add_npe_driver.sh) and run as root with bash ./add_npe_driver.sh di-nslu2.bin. This will create the modified image in di-nslu2-ixp4xx_npe.bin

to:

zrevrmv53hy58tq bad credit private student loans bad credit private student loans

December 03, 2007, at 03:06 PM by fcarolo -- undid spam
Changed lines 1-339 from:

moncaeltor

to:

How to build a new Debian/NSLU2 image

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

General Notes

  • The instructions on this page assume that you are running Debian on your build machine.
  • These instructions are currently preliminary - this wiki page is a work in progress (as are all wiki pages by definition).

Instructions for building the Debian kernel

The Debian Linux Kernel Handbook is a good resource if you get stuck.

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great !

You can also compile yourself a cross-compilation toolchain for arm by using crosstool 0.43. It take about 1 hour on a intel P4 2.6 Ghz. When you have done, don't forget to add your new cross-compilation toolchain into your path.

This section uses 2.6.18 as an example, because it was the latest kernel version at the time of writing. The instructions for building the kernel depend on whether the source is obtained from the subversion respository or from a released version of a Debian kernel.

Source code from the Debian subversion repository

The example used here checks out the trunk version of the Debian kernel support code from the Debian repository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), and change directories to your new directory. Download the appropriate kernel source tarball from the Debian Build Server and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ mkdir ~/src
$ cd ~/src
$ wget http://kernel-archive.buildserver.net/debian-kernel/pool/main/l/linux-2.6/linux-2.6_2.6.20.orig.tar.gz
$ tar xzvf linux-2.6_2.6.20.orig.tar.gz

(:tableend:)

Change directories to the Linux Kernel source directory, and check out the Debian Linux kernel support source tree from the subversion repository (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd linux-2.6-2.6.20
$ svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian debian

(:tableend:)

Install the build-dependencies for the linux-2.6 package. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ sudo apt-get build-dep linux-2.6

(:tableend:)

Source code from a released Debian kernel

To download the source code for the latest kernel for a distribution (e.g. stable, testing, or unstable) either use apt-get, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ apt-get -t [stable | testing | unstable] source linux-2.6

(:tableend:) or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian linux-source package page and unpack the source using dpkg, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.dsc \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz
$ dpkg-source -x linux-2.6_2.6.18-6.dsc linux-2.6.18-6
$ cd linux-2.6.18-6

(:tableend:)

You can also checkout a released version of the Debian kernel from the subversion repository by finding the revision number of the version using the checkin comments at http://svn.debian.org/wsvn/kernel. If you do this, then follow the instructions for setting up the build environment in "Source code from the Debian subversion repository" above.

Building the kernel

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel source revision number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+', and to disable a patch, preceed the atch file name with a '-'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the Debian make files. For example, to compile the arm ixp4xx kernel, do (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:) For other makefile targets, look in debian/rules.gen. The list of currently supported flavours for arm can be found in debian/arch/arm/defines.

Using make menuconfig to customize the kernel

Another way of customizing the kernel configuration is to use the setup build rules, and make menuconfig and friends. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen setup-arm-none-ixp4xx >> ../kernel-build.log 2>&1
$ cd debian/build/build-arm-none-ixp4xx/
$ make ARCH=arm menuconfig
$ cd ../../..
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:)

Either method above will result in a Debian package in the directory above the current directory, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

(:tableend:)

(It should be possible to compile the kernel using make-kpkg, something like this:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

(:tableend:)

but I have not got this to work - any suggestions?)

Copy the .deb file to the slug and install the package: dpkg -i pkgname.deb

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Other useful documents are http://people.debian.org/~fjp/talks/debconf6/paper/ and http://kitenet.net/~joey/blog/entry/my_debian-installer_test_methods.html.

Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

Here are some preliminary instructions on building a Debian installer image for the NSLU2. They are a bit cryptic because they are pretty much a dump of my notes. I will get round to polishing them soon.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

Build and install the kernel that you want use with the installer

Build udebs...
Download linux-kernel-di-arm-2.6.dsc and linux-kernel-di-arm-2.6.tar.gz
apt-get install kernel-wedge fakeroot gcc
dpkg-source -x linux-kernel-di-arm-2.6_1.7.dsc
cd linux-kernel-di-arm-2.6-1.7/
vi kernel-versions
Remove all kernel versions except flavour ixp4xx
Change kernel version to the version desired/built
dpkg-buildpackage -rfakeroot -d -b
-d ignores unmet build-depends (required if you are changing the version of the kernel used)

Build the installer image...
apt-get source debian-installer or check out a copy from the subversion repository
cd debian-installer-yyyymmdd or installer
cp ../*.udeb build/localudebs/

Edit build/config/arm.cfg

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with 
the installer doesn't match the version of the kernel in testing/unstable
ext3-modules-${kernel:Version}
md-modules-${kernel:Version}
nic-modules-${kernel:Version}
scsi-core-modules-${kernel:Version}
usb-storage-modules-${kernel:Version}

sudo apt-get build-dep debian-installer

fakeroot make build_ixp4xx_netboot

The image will be in build/dest/ixp4xx/netboot and will be called di-nslu2.bin

(:tableend:)

Modify an existing installer image initramfs

Rather than building the install image yourself, depending on what you want to do, it may be easier to use an existing image and modify the initramfs. To do this, follow these instructions.

Unpack the image with slugimage (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -u -i di-nslu2.bin

(:tableend:)

Endian swap the init ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

(:tableend:)

Unpack the ramdisk as root (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ su -c 'mkdir initrd'
$ cd initrd
$ su -c 'zcat ../ramdisk-swap.gz | cpio -i'

(:tableend:)

Modify the ramdisk in the way that you want. NB, make all of your changes as root. For instance, to copy the NPE-B microcode to the ramdisk you would do (1/12/2007 These instruction are obsolete, but still work.) (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd initrd
$ cd lib
$ su -c 'mkdir firmware'
$ cd firmware
$ su -c 'cp <path to microcode>/NPE-B.01000201 .'
$ su -c 'ln -s NPE-B.01000201 NPE-B'

(:tableend:)

Then regenerate the ramdisk. Run the following commands in the root directory of the ramdisk. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
$ cd ..

(:tableend:)

Pad to 4 MB and endian swap the new ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
$ devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

(:tableend:)

Create new di image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin
$ sudo upslug2 -i di-nslu2-new.bin

(:tableend:)

Note: If you are building your own kernel, you must byte-swap it too before using it with slugimage: (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< vmlinuz; xp $ 4' > vmlinuz-swap

(:tableend:)

Adding NPE driver to an existing Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. Thus the NPE driver is not included in the official Debian installer image. This section documents the procedure to add the driver and microcode to an existing Debian Installer image so that you don't have to use a USB to Ethernet adapter to install Debian.

You need to manually download the nic-modules-....udeb and unpack it. It can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version name used in the script may be out of date). You will also need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. Alternatively, follow the instructions from the accesslib README. You can extract it by following the script below up to the 'add firmware' section. Place the NPE microcode, nic-modules-....udeb and the di-nslu2.bin in a directory, cd to that directory and run the script below.

Also, because depmod is not run afterwards, you need to add a script that manually loads the module. Something like:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch
cat > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

depmod
modprobe ixp4xx_mac || true
^D

chmod +x lib/debian-installer-startup.d/S05ixp400

(:tableend:)

Putting all of the above together, a script can be created to add the firmware and nic modules to a nightly build of the debian-installer

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

#!/bin/bash
set -e

# unpack the firmware
mkdir di-unpack
cd di-unpack
slugimage -u -i ../$1
devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

#unpack the initramfs
mkdir initrd
cd initrd
zcat ../ramdisk-swap.gz | cpio -i

#add the npe modules
dpkg-deb -x ../../nic-modules-2.6.18-4-ixp4xx-di_1.8_arm.udeb .

#add the firmware
mkdir lib/firmware
cp ../../NPE-B.01000201 lib/firmware/
cd lib/firmware
#make link in firmware dir
ln -s NPE-B.01000201 NPE-B
cd ../..

#update module dependencies
depmod -b `pwd` 2.6.18-4-ixp4xx

#ensure the driver gets loaded
cat <<EOF > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

modprobe ixp4xx_mac || true

EOF
chmod 0755 lib/debian-installer-startup.d/S05ixp400

# build a new initramfs
find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
cd ..

# pad to 4M and byte swap
dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

# build new firmware
slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o ../di-nslu2-ixp4xx_npe.bin

(:tableend:)

Copy the above into a file (e.g. add_npe_driver.sh) and run as root with bash ./add_npe_driver.sh di-nslu2.bin. This will create the modified image in di-nslu2-ixp4xx_npe.bin

November 30, 2007, at 02:27 AM by cooutaeltl -- drondo
Changed lines 1-339 from:

How to build a new Debian/NSLU2 image

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

General Notes

  • The instructions on this page assume that you are running Debian on your build machine.
  • These instructions are currently preliminary - this wiki page is a work in progress (as are all wiki pages by definition).

Instructions for building the Debian kernel

The Debian Linux Kernel Handbook is a good resource if you get stuck.

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great !

You can also compile yourself a cross-compilation toolchain for arm by using crosstool 0.43. It take about 1 hour on a intel P4 2.6 Ghz. When you have done, don't forget to add your new cross-compilation toolchain into your path.

This section uses 2.6.18 as an example, because it was the latest kernel version at the time of writing. The instructions for building the kernel depend on whether the source is obtained from the subversion respository or from a released version of a Debian kernel.

Source code from the Debian subversion repository

The example used here checks out the trunk version of the Debian kernel support code from the Debian repository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), and change directories to your new directory. Download the appropriate kernel source tarball from the Debian Build Server and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ mkdir ~/src
$ cd ~/src
$ wget http://kernel-archive.buildserver.net/debian-kernel/pool/main/l/linux-2.6/linux-2.6_2.6.20.orig.tar.gz
$ tar xzvf linux-2.6_2.6.20.orig.tar.gz

(:tableend:)

Change directories to the Linux Kernel source directory, and check out the Debian Linux kernel support source tree from the subversion repository (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd linux-2.6-2.6.20
$ svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian debian

(:tableend:)

Install the build-dependencies for the linux-2.6 package. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ sudo apt-get build-dep linux-2.6

(:tableend:)

Source code from a released Debian kernel

To download the source code for the latest kernel for a distribution (e.g. stable, testing, or unstable) either use apt-get, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ apt-get -t [stable | testing | unstable] source linux-2.6

(:tableend:) or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian linux-source package page and unpack the source using dpkg, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.dsc \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz \
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz
$ dpkg-source -x linux-2.6_2.6.18-6.dsc linux-2.6.18-6
$ cd linux-2.6.18-6

(:tableend:)

You can also checkout a released version of the Debian kernel from the subversion repository by finding the revision number of the version using the checkin comments at http://svn.debian.org/wsvn/kernel. If you do this, then follow the instructions for setting up the build environment in "Source code from the Debian subversion repository" above.

Building the kernel

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel source revision number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+', and to disable a patch, preceed the atch file name with a '-'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the Debian make files. For example, to compile the arm ixp4xx kernel, do (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:) For other makefile targets, look in debian/rules.gen. The list of currently supported flavours for arm can be found in debian/arch/arm/defines.

Using make menuconfig to customize the kernel

Another way of customizing the kernel configuration is to use the setup build rules, and make menuconfig and friends. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd ~/src/linux-2.6-2.6.18
$ fakeroot debian/rules clean
$ fakeroot debian/rules debian/control
$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1
$ fakeroot make -f debian/rules.gen setup-arm-none-ixp4xx >> ../kernel-build.log 2>&1
$ cd debian/build/build-arm-none-ixp4xx/
$ make ARCH=arm menuconfig
$ cd ../../..
$ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

(:tableend:)

Either method above will result in a Debian package in the directory above the current directory, e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

(:tableend:)

(It should be possible to compile the kernel using make-kpkg, something like this:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

(:tableend:)

but I have not got this to work - any suggestions?)

Copy the .deb file to the slug and install the package: dpkg -i pkgname.deb

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Other useful documents are http://people.debian.org/~fjp/talks/debconf6/paper/ and http://kitenet.net/~joey/blog/entry/my_debian-installer_test_methods.html.

Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

Here are some preliminary instructions on building a Debian installer image for the NSLU2. They are a bit cryptic because they are pretty much a dump of my notes. I will get round to polishing them soon.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

Build and install the kernel that you want use with the installer

Build udebs...
Download linux-kernel-di-arm-2.6.dsc and linux-kernel-di-arm-2.6.tar.gz
apt-get install kernel-wedge fakeroot gcc
dpkg-source -x linux-kernel-di-arm-2.6_1.7.dsc
cd linux-kernel-di-arm-2.6-1.7/
vi kernel-versions
Remove all kernel versions except flavour ixp4xx
Change kernel version to the version desired/built
dpkg-buildpackage -rfakeroot -d -b
-d ignores unmet build-depends (required if you are changing the version of the kernel used)

Build the installer image...
apt-get source debian-installer or check out a copy from the subversion repository
cd debian-installer-yyyymmdd or installer
cp ../*.udeb build/localudebs/

Edit build/config/arm.cfg

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with 
the installer doesn't match the version of the kernel in testing/unstable
ext3-modules-${kernel:Version}
md-modules-${kernel:Version}
nic-modules-${kernel:Version}
scsi-core-modules-${kernel:Version}
usb-storage-modules-${kernel:Version}

sudo apt-get build-dep debian-installer

fakeroot make build_ixp4xx_netboot

The image will be in build/dest/ixp4xx/netboot and will be called di-nslu2.bin

(:tableend:)

Modify an existing installer image initramfs

Rather than building the install image yourself, depending on what you want to do, it may be easier to use an existing image and modify the initramfs. To do this, follow these instructions.

Unpack the image with slugimage (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -u -i di-nslu2.bin

(:tableend:)

Endian swap the init ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

(:tableend:)

Unpack the ramdisk as root (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ su -c 'mkdir initrd'
$ cd initrd
$ su -c 'zcat ../ramdisk-swap.gz | cpio -i'

(:tableend:)

Modify the ramdisk in the way that you want. NB, make all of your changes as root. For instance, to copy the NPE-B microcode to the ramdisk you would do (1/12/2007 These instruction are obsolete, but still work.) (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd initrd
$ cd lib
$ su -c 'mkdir firmware'
$ cd firmware
$ su -c 'cp <path to microcode>/NPE-B.01000201 .'
$ su -c 'ln -s NPE-B.01000201 NPE-B'

(:tableend:)

Then regenerate the ramdisk. Run the following commands in the root directory of the ramdisk. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
$ cd ..

(:tableend:)

Pad to 4 MB and endian swap the new ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
$ devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

(:tableend:)

Create new di image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin
$ sudo upslug2 -i di-nslu2-new.bin

(:tableend:)

Note: If you are building your own kernel, you must byte-swap it too before using it with slugimage: (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< vmlinuz; xp $ 4' > vmlinuz-swap

(:tableend:)

Adding NPE driver to an existing Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. Thus the NPE driver is not included in the official Debian installer image. This section documents the procedure to add the driver and microcode to an existing Debian Installer image so that you don't have to use a USB to Ethernet adapter to install Debian.

You need to manually download the nic-modules-....udeb and unpack it. It can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version name used in the script may be out of date). You will also need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. Alternatively, follow the instructions from the accesslib README. You can extract it by following the script below up to the 'add firmware' section. Place the NPE microcode, nic-modules-....udeb and the di-nslu2.bin in a directory, cd to that directory and run the script below.

Also, because depmod is not run afterwards, you need to add a script that manually loads the module. Something like:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch
cat > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

depmod
modprobe ixp4xx_mac || true
^D

chmod +x lib/debian-installer-startup.d/S05ixp400

(:tableend:)

Putting all of the above together, a script can be created to add the firmware and nic modules to a nightly build of the debian-installer

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

#!/bin/bash
set -e

# unpack the firmware
mkdir di-unpack
cd di-unpack
slugimage -u -i ../$1
devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

#unpack the initramfs
mkdir initrd
cd initrd
zcat ../ramdisk-swap.gz | cpio -i

#add the npe modules
dpkg-deb -x ../../nic-modules-2.6.18-4-ixp4xx-di_1.8_arm.udeb .

#add the firmware
mkdir lib/firmware
cp ../../NPE-B.01000201 lib/firmware/
cd lib/firmware
#make link in firmware dir
ln -s NPE-B.01000201 NPE-B
cd ../..

#update module dependencies
depmod -b `pwd` 2.6.18-4-ixp4xx

#ensure the driver gets loaded
cat <<EOF > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

modprobe ixp4xx_mac || true

EOF
chmod 0755 lib/debian-installer-startup.d/S05ixp400

# build a new initramfs
find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
cd ..

# pad to 4M and byte swap
dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

# build new firmware
slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o ../di-nslu2-ixp4xx_npe.bin

(:tableend:)

Copy the above into a file (e.g. add_npe_driver.sh) and run as root with bash ./add_npe_driver.sh di-nslu2.bin. This will create the modified image in di-nslu2-ixp4xx_npe.bin

to:

moncaeltor

October 27, 2007, at 03:51 PM by dumfrac -- Further fix to ramdisk regeneragtion instructions.
Deleted line 222:

$ cd ..

Changed line 226 from:

Then regenerate the ramdisk

to:

Then regenerate the ramdisk. Run the following commands in the root directory of the ramdisk.

October 27, 2007, at 03:42 PM by dumfrac -- Clarify ramdisk instructions.
Changed lines 207-208 from:

$ su $ mkdir initrd

to:

$ su -c 'mkdir initrd'

Deleted lines 216-217:

$ su $ mkdir initrd

Deleted line 217:

$ su -c 'zcat ../ramdisk-swap.gz | cpio -i'

October 27, 2007, at 03:40 PM by dumfrac -- Fix unpacking ramdisk instructions
Changed lines 207-210 from:

$ su -c 'zcat /boot/initrd.img-2.6.18-3-686 | cpio -i'

to:

$ su $ mkdir initrd $ cd initrd $ su -c 'zcat ../ramdisk-swap.gz | cpio -i'

October 13, 2007, at 02:43 PM by guillaume membre --
Changed line 61 from:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian kernel package page and unpack the source using dpkg, e.g.

to:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian linux-source package page and unpack the source using dpkg, e.g.

October 13, 2007, at 02:41 PM by guillaume membre -- added link to the debian kernel package page and link to crosstool
Added lines 16-17:

You can also compile yourself a cross-compilation toolchain for arm by using crosstool 0.43. It take about 1 hour on a intel P4 2.6 Ghz. When you have done, don't forget to add your new cross-compilation toolchain into your path.

Changed line 61 from:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror and unpack the source using dpkg, e.g.

to:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror or from the Debian kernel package page and unpack the source using dpkg, e.g.

October 10, 2007, at 10:13 PM by guillaume membre --
Added line 108:

$ cd ../../..

June 19, 2007, at 11:24 AM by DeanScarff -- Add link to instructions on building the microcode
Changed lines 264-265 from:

You need to manually download the nic-modules-....udeb and unpack it. It can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version name used in the script may be out of date). You will also need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. You can extract it by following the script below up to the 'add firmware' section. Place the NPE microcode, nic-modules-....udeb and the di-nslu2.bin in a directory, cd to that directory and run the script below.

to:

You need to manually download the nic-modules-....udeb and unpack it. It can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version name used in the script may be out of date). You will also need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. Alternatively, follow the instructions from the accesslib README. You can extract it by following the script below up to the 'add firmware' section. Place the NPE microcode, nic-modules-....udeb and the di-nslu2.bin in a directory, cd to that directory and run the script below.

May 28, 2007, at 09:53 AM by marcusb -- Note that a kernel must be byte-swapped before using with slugimage
Added lines 252-259:

Note: If you are building your own kernel, you must byte-swap it too before using it with slugimage: (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< vmlinuz; xp $ 4' > vmlinuz-swap

(:tableend:)

March 07, 2007, at 08:48 PM by Stein -- Fix bug i script \"Adding NPE driver to an existing Debian Installer image
Changed lines 300-301 from:

ln -s NPE-B.01000201 lib/firmware/NPE-B

to:

cd lib/firmware

  1. make link in firmware dir

ln -s NPE-B.01000201 NPE-B cd ../..

February 26, 2007, at 02:15 PM by emm_is --
Changed lines 256-257 from:

You need to manually download the nic-modules-....udeb and unpack it. They can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version names may be out of date here). You will need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. You can extract it by flowing the script below up to the 'add firmware' section.

to:

You need to manually download the nic-modules-....udeb and unpack it. It can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version name used in the script may be out of date). You will also need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. You can extract it by following the script below up to the 'add firmware' section. Place the NPE microcode, nic-modules-....udeb and the di-nslu2.bin in a directory, cd to that directory and run the script below.

February 26, 2007, at 01:59 PM by emm_is -- a few notes about where to find the binaries
Changed lines 256-257 from:

You need to manually download the nic-modules-....udeb and unpack it. Also, because depmod is not run afterwards, you need to add a script that manually loads the module. Something like

to:

You need to manually download the nic-modules-....udeb and unpack it. They can be found at http://packages.debian.net/unstable/nic-modules-2.6.18-4-ixp4xx-di/arm/download (version names may be out of date here). You will need the NPE microcode 'NPE-B.01000201', one place to obtain it is from the current debian installer past the click through license on this site. You can extract it by flowing the script below up to the 'add firmware' section.

Also, because depmod is not run afterwards, you need to add a script that manually loads the module. Something like:

Changed lines 299-301 from:

cp ../../NPE-B.01000200 lib/firmware/ ln -s NPE-B.01000200 lib/firmware/NPE-B

to:

cp ../../NPE-B.01000201 lib/firmware/ ln -s NPE-B.01000201 lib/firmware/NPE-B

February 15, 2007, at 12:11 PM by fcarolo -- fixed commands for padding and byte swapping
Changed line 196 from:

$ devio '<< ramdisk.gz; xp $,4' > ramdisk-swap.gz

to:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

Changed lines 238-239 from:

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz $ devio '<< new-ramdisk-swap.gz; xp $,4' > new-ramdisk.gz

to:

$ dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync $ devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

February 14, 2007, at 07:49 PM by tenfoot --
Changed line 325 from:

Copy the above into a file (e.g. add_npe_driver.sh) and run as root with bash ./add_npe_driver.sh di-nslu2.bin

to:

Copy the above into a file (e.g. add_npe_driver.sh) and run as root with bash ./add_npe_driver.sh di-nslu2.bin. This will create the modified image in di-nslu2-ixp4xx_npe.bin

February 14, 2007, at 07:48 PM by tenfoot -- Add NPE firmware addition script
Deleted lines 253-254:

These instructions need some work...

Changed line 262 from:

cat > lib/debian-installer-startup.d/S90ixp400

to:

cat > lib/debian-installer-startup.d/S05ixp400

Changed line 266 from:

modprobe ixp4xx_npe || true

to:

modprobe ixp4xx_mac || true

Changed line 269 from:

chmod +x lib/debian-installer-startup.d/S90ixp400

to:

chmod +x lib/debian-installer-startup.d/S05ixp400

Added lines 272-325:

Putting all of the above together, a script can be created to add the firmware and nic modules to a nightly build of the debian-installer

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

#!/bin/bash
set -e

# unpack the firmware
mkdir di-unpack
cd di-unpack
slugimage -u -i ../$1
devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

#unpack the initramfs
mkdir initrd
cd initrd
zcat ../ramdisk-swap.gz | cpio -i

#add the npe modules
dpkg-deb -x ../../nic-modules-2.6.18-4-ixp4xx-di_1.8_arm.udeb .

#add the firmware
mkdir lib/firmware
cp ../../NPE-B.01000200 lib/firmware/
ln -s NPE-B.01000200 lib/firmware/NPE-B

#update module dependencies
depmod -b `pwd` 2.6.18-4-ixp4xx

#ensure the driver gets loaded
cat <<EOF > lib/debian-installer-startup.d/S05ixp400
#!/bin/sh

modprobe ixp4xx_mac || true

EOF
chmod 0755 lib/debian-installer-startup.d/S05ixp400

# build a new initramfs
find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
cd ..

# pad to 4M and byte swap
dd if=new-ramdisk-swap.gz of=new-ramdisk-swap-pad.gz ibs=4M conv=sync
devio '<< new-ramdisk-swap-pad.gz; xp $ 4' > new-ramdisk.gz

# build new firmware
slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o ../di-nslu2-ixp4xx_npe.bin

(:tableend:)

Copy the above into a file (e.g. add_npe_driver.sh) and run as root with bash ./add_npe_driver.sh di-nslu2.bin

February 14, 2007, at 11:21 AM by fcarolo -- fixed devio command line
Changed line 196 from:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

to:

$ devio '<< ramdisk.gz; xp $,4' > ramdisk-swap.gz

Changed line 239 from:

$ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

to:

$ devio '<< new-ramdisk-swap.gz; xp $,4' > new-ramdisk.gz

February 13, 2007, at 01:43 PM by dumfrac -- Add a link to the Debian Linux Kernel Handbook
Added lines 12-13:

The Debian Linux Kernel Handbook is a good resource if you get stuck.

February 13, 2007, at 01:39 PM by dumfrac -- Add alternative method of changing the kernel configuration
Changed lines 73-74 from:

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel.

to:

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel. Two methods for customizing the kernel configuration are presented here. The first is completely manual, and the second uses make menuconfig and friends.

Customizing the kernel manually
Changed lines 93-95 from:

The result of the build will be a Debian package in the directory above the current directory, e.g.

to:
Using make menuconfig to customize the kernel

Another way of customizing the kernel configuration is to use the setup build rules, and make menuconfig and friends.

Changed lines 99-106 from:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

to:

$ cd ~/src/linux-2.6-2.6.18 $ fakeroot debian/rules clean $ fakeroot debian/rules debian/control $ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen setup-arm-none-ixp4xx >> ../kernel-build.log 2>&1 $ cd debian/build/build-arm-none-ixp4xx/ $ make ARCH=arm menuconfig $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

Changed lines 110-111 from:

(It should be possible to compile the kernel using make-kpkg, something like this:

to:

Either method above will result in a Debian package in the directory above the current directory, e.g.

Changed line 114 from:

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

to:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

Added lines 118-126:

(It should be possible to compile the kernel using make-kpkg, something like this:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

(:tableend:)

February 13, 2007, at 01:18 PM by dumfrac -- Add some missing commands to the kernel build commands
Added lines 83-84:

$ fakeroot debian/rules clean $ fakeroot debian/rules debian/control

February 12, 2007, at 05:00 AM by dumfrac --
Changed line 27 from:

$ tar xzvf linux-2.6.20.tar.gz

to:

$ tar xzvf linux-2.6_2.6.20.orig.tar.gz

February 12, 2007, at 04:59 AM by dumfrac -- Update kernel build instructions
Changed line 20 from:

Create a directory (e.g. ~/src), change directories to your new directory, check out the Debian Linux kernel support source tree from the subversion repository, and install the build-dependencies

to:

Create a directory (e.g. ~/src), and change directories to your new directory. Download the appropriate kernel source tarball from the Debian Build Server and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version.

Changed lines 26-27 from:

$ svn co svn://svn.debian.org/svn/kernel/dists/trunk linux-2.6 $ sudo apt-get build-dep linux-2.6

to:

$ wget http://kernel-archive.buildserver.net/debian-kernel/pool/main/l/linux-2.6/linux-2.6_2.6.20.orig.tar.gz $ tar xzvf linux-2.6.20.tar.gz

Changed line 31 from:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version.

to:

Change directories to the Linux Kernel source directory, and check out the Debian Linux kernel support source tree from the subversion repository

Changed lines 35-36 from:

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.19.tar.gz $ tar xzvf linux-2.6.18.tar.gz

to:

$ cd linux-2.6-2.6.20 $ svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian debian

Changed line 40 from:

Change directory to the kernel source directory that was created, and create a symlink to the debian directory.

to:

Install the build-dependencies for the linux-2.6 package.

Changed lines 44-45 from:

$ cd linux-2.6.18 $ ln -s ../linux-2.6/debian debian

to:

$ sudo apt-get build-dep linux-2.6

Changed line 82 from:

$ cd ~/src/linux-2.6.18-6

to:

$ cd ~/src/linux-2.6-2.6.18

Deleted lines 109-110:

Alternatively, use vmlinuz in ... and update-initramfs ... (complete these instructions).

January 20, 2007, at 09:24 PM by hs -- removed »apt-get install linux-source-2.6.18«. This is not equivalent: the &#8250;debian&#8249; directory is missing
Deleted lines 69-76:

or get the source code package:

# apt-get install linux-source-2.6.18

This will leave a tar file in /usr/src; I think it's the same as you'd get using the first method.

January 19, 2007, at 03:30 AM by dumfrac --
Changed lines 152-153 from:

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with the installer doesn't match the version of the kernel in testing/unstable

to:

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with the installer doesn't match the version of the kernel in testing/unstable

January 18, 2007, at 06:56 AM by dumfrac -- Fix instructions to build installer (I shouldn\'t be doing this when it is so late)
Changed lines 135-136 from:

apt-get source linux-kernel-di-arm-2.6 (check this - I wasn't taking great notes at this stage) Change kernel version in config/arm/netboot.cfg (check this) to the version desired/built

to:

Download linux-kernel-di-arm-2.6.dsc and linux-kernel-di-arm-2.6.tar.gz apt-get install kernel-wedge fakeroot gcc dpkg-source -x linux-kernel-di-arm-2.6_1.7.dsc cd linux-kernel-di-arm-2.6-1.7/ vi kernel-versions Remove all kernel versions except flavour ixp4xx Change kernel version to the version desired/built

January 18, 2007, at 06:51 AM by dumfrac --
Changed lines 147-148 from:

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with the installer doesn't match the version of the kernel in testing/unstable

to:

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with the installer doesn't match the version of the kernel in testing/unstable

January 18, 2007, at 06:50 AM by dumfrac -- Add preliminary instructions for building the debian installer
Changed lines 127-131 from:

Modify an existing installer image initramfs

Rather than building the install image yourself, depending on what you want to do, it may be easier to use an existing image and modify the initramfs. To do this, follow these instructions.

Unpack the image with slugimage

to:

Here are some preliminary instructions on building a Debian installer image for the NSLU2. They are a bit cryptic because they are pretty much a dump of my notes. I will get round to polishing them soon.

Changed lines 132-158 from:

$ slugimage -u -i di-nslu2.bin

to:

Build and install the kernel that you want use with the installer

Build udebs... apt-get source linux-kernel-di-arm-2.6 (check this - I wasn't taking great notes at this stage) Change kernel version in config/arm/netboot.cfg (check this) to the version desired/built dpkg-buildpackage -rfakeroot -d -b -d ignores unmet build-depends (required if you are changing the version of the kernel used)

Build the installer image... apt-get source debian-installer or check out a copy from the subversion repository cd debian-installer-yyyymmdd or installer cp ../*.udeb build/localudebs/

Edit build/config/arm.cfg

Add any udebs to build/pkg-lists/netboot/local if the kernel version you want to use with the installer doesn't match the version of the kernel in testing/unstable ext3-modules-${kernel:Version} md-modules-${kernel:Version} nic-modules-${kernel:Version} scsi-core-modules-${kernel:Version} usb-storage-modules-${kernel:Version}

sudo apt-get build-dep debian-installer

fakeroot make build_ixp4xx_netboot

The image will be in build/dest/ixp4xx/netboot and will be called di-nslu2.bin

Changed lines 162-166 from:

Endian swap the init ramdisk

to:

Modify an existing installer image initramfs

Rather than building the install image yourself, depending on what you want to do, it may be easier to use an existing image and modify the initramfs. To do this, follow these instructions.

Unpack the image with slugimage

Changed line 170 from:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

to:

$ slugimage -u -i di-nslu2.bin

Changed line 174 from:

Unpack the ramdisk as root

to:

Endian swap the init ramdisk

Changed line 178 from:

$ su -c 'zcat /boot/initrd.img-2.6.18-3-686 | cpio -i'

to:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

Changed line 182 from:

Modify the ramdisk in the way that you want. NB, make all of your changes as root. For instance, to copy the NPE-B microcode to the ramdisk you would do (1/12/2007 These instruction are obsolete, but still work.)

to:

Unpack the ramdisk as root

Added lines 186-193:

$ su -c 'zcat /boot/initrd.img-2.6.18-3-686 | cpio -i' @] (:tableend:)

Modify the ramdisk in the way that you want. NB, make all of your changes as root. For instance, to copy the NPE-B microcode to the ramdisk you would do (1/12/2007 These instruction are obsolete, but still work.) (:table border=0 width=80% bgcolor=#eeffee:) (:cell:) [@

January 15, 2007, at 10:00 PM by dumfrac -- Add links to documents about building the Debian Installer
Changed lines 123-124 from:

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

to:

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Other useful documents are http://people.debian.org/~fjp/talks/debconf6/paper/ and http://kitenet.net/~joey/blog/entry/my_debian-installer_test_methods.html.

Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

January 12, 2007, at 03:21 PM by dumfrac -- Add note about rwhitby\'s Makefile for build the cross compiler toolchain, and fixup sections on working with the initramfs
Changed lines 12-13 from:

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated.

to:

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated. Rod Whitby has very kindly automated the steps required to build this toolchain in a Makefile which works great !

Changed lines 18-19 from:

The example used here checks out the trunk version of the Debian kernel support code from the Debian respository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

to:

The example used here checks out the trunk version of the Debian kernel support code from the Debian repository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Changed line 31 from:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version (FIXME: what are the names given to the x.y.z and x.y.z.a kernel versions and patches).

to:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version.

Changed line 36 from:

$ tar xzvf linux-2.6.19.tar.gz

to:

$ tar xzvf linux-2.6.18.tar.gz

Changed line 44 from:

$ cd linux-2.6.19

to:

$ cd linux-2.6.18

Changed lines 82-83 from:

From this point on, the instructions are the same. Now you are ready to make any changes to the kernel.

to:

From this point on, the instructions for both source trees are the same. Now you are ready to make any changes to the kernel.

Changed lines 85-86 from:
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel revision (?) number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.
to:
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel source revision number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+', and to disable a patch, preceed the atch file name with a '-'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.
Added lines 108-109:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

Changed lines 113-114 from:
to:

(:tableend:)

Deleted line 116:
Changed lines 123-131 from:

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build.

Adding NPE-B microcode to an existing Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. This section documents the procedure to add the microcode to an existing Debian Installer image.

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm daily images can be found at http://people.debian.org/~kmuto/d-i/images/daily/. A summary of the status of the daily builds can be found at http://people.debian.org/~joeyh/d-i/build-logs.html.

Unpack the image

to:

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build. Daily builds of the installer for ARM are at http://people.debian.org/~kmuto/d-i/images/daily/ but are not guaranteed to work. The status of the daily builds are at http://people.debian.org/~joeyh/d-i/build-logs.html.

Modify an existing installer image initramfs

Rather than building the install image yourself, depending on what you want to do, it may be easier to use an existing image and modify the initramfs. To do this, follow these instructions.

Unpack the image with slugimage

Changed line 145 from:

Copy the microcode to the ramdisk

to:

Unpack the ramdisk as root

Added lines 149-156:

$ su -c 'zcat /boot/initrd.img-2.6.18-3-686 | cpio -i' @] (:tableend:)

Modify the ramdisk in the way that you want. NB, make all of your changes as root. For instance, to copy the NPE-B microcode to the ramdisk you would do (1/12/2007 These instruction are obsolete, but still work.) (:table border=0 width=80% bgcolor=#eeffee:) (:cell:) [@

Changed line 170 from:

Copy the ethernet driver to the ramdisk (this step should be removed once the modules are added to the daily build)

to:

Then regenerate the ramdisk

Changed lines 174-177 from:

$ cd modules/2.6.18-2-ixp4xx/kernel/drivers/net/ $ su -c 'mkdir ixp4xx' $ su -c 'cp <path to modules>/ixp4xx* ixp4xx/' $ cd ../../../../../..

to:

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz $ cd ..

Changed line 179 from:

Regenerate the ramdisk

to:

Pad to 4 MB and endian swap the new ramdisk

Changed lines 183-184 from:

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz $ cd ..

to:

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz $ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

Changed line 188 from:

Pad to 4 MB and endian swap the new ramdisk

to:

Create new di image

Changed lines 192-193 from:

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz $ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

to:

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin $ sudo upslug2 -i di-nslu2-new.bin

Changed lines 197-204 from:

Create new di image

to:

Adding NPE driver to an existing Debian Installer image

These instructions need some work...

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. Thus the NPE driver is not included in the official Debian installer image. This section documents the procedure to add the driver and microcode to an existing Debian Installer image so that you don't have to use a USB to Ethernet adapter to install Debian.

You need to manually download the nic-modules-....udeb and unpack it. Also, because depmod is not run afterwards, you need to add a script that manually loads the module. Something like

Changed lines 208-209 from:

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin $ sudo upslug2 -i di-nslu2-new.bin

to:

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch cat > lib/debian-installer-startup.d/S90ixp400

  1. !/bin/sh

depmod modprobe ixp4xx_npe || true ^D

chmod +x lib/debian-installer-startup.d/S90ixp400

December 18, 2006, at 04:04 PM by JohnReiser -- example command to install kernel on slug
Changed lines 115-116 from:

Copy the .deb file to the slug and install the package.

to:

Copy the .deb file to the slug and install the package: dpkg -i pkgname.deb

December 08, 2006, at 12:08 PM by Phil Endecott -- Mention linux-source-* packages, and make-kpkg
Changed lines 18-20 from:

The example used here checks out the trunk version of the kernel in the Debian respository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), change directories to your new directory, check out the Debian Linux kernel source tree from the subversion repository, and install the build-dependencies

to:

The example used here checks out the trunk version of the Debian kernel support code from the Debian respository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), change directories to your new directory, check out the Debian Linux kernel support source tree from the subversion repository, and install the build-dependencies

Added lines 70-77:

or get the source code package:

# apt-get install linux-source-2.6.18

This will leave a tar file in /usr/src; I think it's the same as you'd get using the first method.

Changed lines 106-107 from:

Copy this file to the slug and install the package.

to:

(It should be possible to compile the kernel using make-kpkg, something like this:

$ make-kpkg --arch arm --cross-compile arm-linux-gnu- binary-arch

but I have not got this to work - any suggestions?)

Copy the .deb file to the slug and install the package.

December 05, 2006, at 06:02 AM by rwhitby --
Changed lines 65-66 from:

$ dpkg-source -x linux-2.6_2.6.18-6.dsc $ cd linux-2.6-2.6.18

to:

$ dpkg-source -x linux-2.6_2.6.18-6.dsc linux-2.6.18-6 $ cd linux-2.6.18-6

Changed line 83 from:

$ cd ~/src/linux-2.6.18

to:

$ cd ~/src/linux-2.6.18-6

December 05, 2006, at 06:00 AM by rwhitby --
Changed line 84 from:

$ fakeroot debian/rules debian/build debian/stamps debian/control > ../kernel-build.log 2>&1

to:

$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1

December 05, 2006, at 05:33 AM by rwhitby --
Changed lines 35-36 from:

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.tar.gz $ tar xzvf linux-2.6.18.tar.gz

to:

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.19.tar.gz $ tar xzvf linux-2.6.19.tar.gz

Changed line 44 from:

$ cd linux-2.6-18

to:

$ cd linux-2.6.19

Changed line 84 from:

$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1

to:

$ fakeroot debian/rules debian/build debian/stamps debian/control > ../kernel-build.log 2>&1

November 26, 2006, at 04:23 AM by dumfrac -- Fix link and indent code segment
Changed line 58 from:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian [http://www.debian.org/mirror/list | mirror] and unpack the source using dpkg, e.g.

to:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian mirror and unpack the source using dpkg, e.g.

Changed lines 63-64 from:

http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz

to:
       http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz        http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz
November 26, 2006, at 04:21 AM by dumfrac -- Distinguish between building from repository and building from packages sources
Changed lines 7-10 from:

The instructions on this page assume that you are running Debian on your build machine.

Build the Debian kernel (latest trunk version)

to:
  • The instructions on this page assume that you are running Debian on your build machine.
  • These instructions are currently preliminary - this wiki page is a work in progress (as are all wiki pages by definition).

Instructions for building the Debian kernel

Changed lines 14-16 from:

This sections uses 2.6.18 as an exmaple, because it was the latest kernel version at the time of writing.

Once you have a cross-compilation toolchain, create a directory (e.g. ~/src), change directories to your new directory, check out the Debian Linux kernel source tree from the subversion repository, and install the build-dependencies

to:

This section uses 2.6.18 as an example, because it was the latest kernel version at the time of writing. The instructions for building the kernel depend on whether the source is obtained from the subversion respository or from a released version of a Debian kernel.

Source code from the Debian subversion repository

The example used here checks out the trunk version of the kernel in the Debian respository. If you want another distribution (e.g. sid), replace 'trunk' with 'sid' in the instructions below. Note that trunk or sid may not always build.

Create a directory (e.g. ~/src), change directories to your new directory, check out the Debian Linux kernel source tree from the subversion repository, and install the build-dependencies

Changed lines 49-54 from:

Now you are ready to make any changes to the kernel.

  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel revision (?) number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the following commands

to:

Source code from a released Debian kernel

To download the source code for the latest kernel for a distribution (e.g. stable, testing, or unstable) either use apt-get, e.g.

Changed lines 55-57 from:

$ cd ~/src/linux-2.6.18 $ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

to:

$ apt-get -t [stable | testing | unstable] source linux-2.6

Changed lines 58-59 from:

The result will be a Debian package in your build directory (~/src) e.g.

to:

or download the .tar.gz, .diff.gz, and .dsc files for the kernel from a Debian [http://www.debian.org/mirror/list | mirror] and unpack the source using dpkg, e.g.

Changed lines 62-66 from:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

to:

$ wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.dsc http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18.orig.tar.gz http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-2.6_2.6.18-6.diff.gz $ dpkg-source -x linux-2.6_2.6.18-6.dsc $ cd linux-2.6-2.6.18

Changed lines 70-84 from:

Copy this file to the slug and install the package.

Alternatively, use vmlinuz in ... and update-initramfs ... (complete these instructions).

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build.

Adding NPE-B microcode to an existing Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. This section documents the procedure to add the microcode to an existing Debian Installer image.

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm daily images can be found at http://people.debian.org/~kmuto/d-i/images/daily/.

Unpack the image

to:

You can also checkout a released version of the Debian kernel from the subversion repository by finding the revision number of the version using the checkin comments at http://svn.debian.org/wsvn/kernel. If you do this, then follow the instructions for setting up the build environment in "Source code from the Debian subversion repository" above.

Building the kernel

From this point on, the instructions are the same. Now you are ready to make any changes to the kernel.

  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel revision (?) number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.

Once you are happy with your changes, compile the kernel using the Debian make files. For example, to compile the arm ixp4xx kernel, do

Changed lines 83-85 from:

$ slugimage -u -i di-nslu2.bin

to:

$ cd ~/src/linux-2.6.18 $ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

Changed lines 88-89 from:

Endian swap the init ramdisk

to:

For other makefile targets, look in debian/rules.gen. The list of currently supported flavours for arm can be found in debian/arch/arm/defines.

The result of the build will be a Debian package in the directory above the current directory, e.g.

Changed line 94 from:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

to:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

Changed lines 98-112 from:

Copy the microcode to the ramdisk

to:

Copy this file to the slug and install the package.

Alternatively, use vmlinuz in ... and update-initramfs ... (complete these instructions).

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build.

Adding NPE-B microcode to an existing Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. This section documents the procedure to add the microcode to an existing Debian Installer image.

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm daily images can be found at http://people.debian.org/~kmuto/d-i/images/daily/. A summary of the status of the daily builds can be found at http://people.debian.org/~joeyh/d-i/build-logs.html.

Unpack the image

Changed lines 116-125 from:

$ su $ mkdir initrd $ cd initrd $ su -c 'zcat ../ramdisk-swap.gz | cpio -i' $ cd lib $ su -c 'mkdir firmware' $ cd firmware $ su -c 'cp <path to microcode>/NPE-B.01000201 .' $ su -c 'ln -s NPE-B.01000201 NPE-B' $ cd ..

to:

$ slugimage -u -i di-nslu2.bin

Changed line 120 from:

Copy the ethernet driver to the ramdisk (this step should be removed once the modules are added to the daily build)

to:

Endian swap the init ramdisk

Changed lines 124-127 from:

$ cd modules/2.6.18-2-ixp4xx/kernel/drivers/net/ $ su -c 'mkdir ixp4xx' $ su -c 'cp <path to modules>/ixp4xx* ixp4xx/' $ cd ../../../../../..

to:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

Changed line 128 from:

Regenerate the ramdisk

to:

Copy the microcode to the ramdisk

Changed lines 132-140 from:

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz

to:

$ su $ mkdir initrd $ cd initrd $ su -c 'zcat ../ramdisk-swap.gz | cpio -i' $ cd lib $ su -c 'mkdir firmware' $ cd firmware $ su -c 'cp <path to microcode>/NPE-B.01000201 .' $ su -c 'ln -s NPE-B.01000201 NPE-B'

Changed line 145 from:

Pad to 4 MB and endian swap the new ramdisk

to:

Copy the ethernet driver to the ramdisk (this step should be removed once the modules are added to the daily build)

Changed lines 149-150 from:

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz $ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

to:

$ cd modules/2.6.18-2-ixp4xx/kernel/drivers/net/ $ su -c 'mkdir ixp4xx' $ su -c 'cp <path to modules>/ixp4xx* ixp4xx/' $ cd ../../../../../..

Changed line 156 from:

Create new di image

to:

Regenerate the ramdisk

Changed lines 160-161 from:

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin $ sudo upslug2 -i di-nslu2-new.bin

to:

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz $ cd ..

Added lines 164-181:

Pad to 4 MB and endian swap the new ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz
$ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

(:tableend:)

Create new di image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin
$ sudo upslug2 -i di-nslu2-new.bin

(:tableend:)

November 25, 2006, at 09:20 PM by dumfrac -- Remove the preliminary message regard the kernel build instructions
Deleted lines 10-11:

These instructions are not complete yet and will not work as is - this is a work in progress.

November 25, 2006, at 09:19 PM by dumfrac --
Changed lines 13-16 from:

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a tool chain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated.

The rest of the instructions use 2.6.18 as an exmaple, because it was the latest kernel version at the time of writing.

to:

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a toolchain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated.

This sections uses 2.6.18 as an exmaple, because it was the latest kernel version at the time of writing.

Changed line 28 from:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version (FIXME: update this text, what are the neames given to the x.y.z and x.y.z.a kernel versions and patches).

to:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version (FIXME: what are the names given to the x.y.z and x.y.z.a kernel versions and patches).

Changed lines 48-50 from:
  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). Kernel config options for all architectures are in debian/arch/config.Remember to make check the Kconfig dependencies.
  • Kernel patches are found in debian/patches. and patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel revision (?) number, and the patches listed in these files are applied in the order listed.
to:
  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). For example, kernel options for all arm architecture flavours are in debian/arch/arm/config, and kernel options specific to the ixp4xx flavour are in debian/arch/arm/config.ixp4xx. Kernel config options for all architectures are in debian/arch/config. Remember to make check the Kconfig dependencies.
  • Kernel patches are in debian/patches. Patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel revision (?) number, and the patches in these files are applied in the order listed. To enable a patch, preceed the patch file name with a '+'. Make changes to the kernel source by adding new patches to debian/patches, and then add the patch to the latest revision file in debian/patches/series.
Added line 55:

$ cd ~/src/linux-2.6.18

Changed line 61 from:

The result will be a Debian package in your build directory (~/src/kernel) e.g.

to:

The result will be a Debian package in your build directory (~/src) e.g.

Added line 68:
November 25, 2006, at 08:26 PM by dumfrac --
Changed lines 3-4 from:

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

to:

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

General Notes

The instructions on this page assume that you are running Debian on your build machine.

Changed lines 13-17 from:

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. There are several ways to do this, but I have found great instructions for Debian at http://wiki.debian.org/BuildingCrossCompilers. Note that every time gcc or binutils is updated, you will have to redo this procedure.

Others have noted that emDebian works well these days, and is apparently much less labor intensive.

Once you have a cross-compilation toolchain, create a directory (e.g. ~/src), change directories to your new directory, download the Debian linux-2.6 source from the subversion repository, and install the build-dependencies

to:

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. emDebian has been developed specifically for this purpose, and apparently works well these days. You can also manually create a tool chain by following the instructions at http://wiki.debian.org/BuildingCrossCompilers. Note that you will have to redo the manual procedure every time gcc or binutils is updated.

The rest of the instructions use 2.6.18 as an exmaple, because it was the latest kernel version at the time of writing.

Once you have a cross-compilation toolchain, create a directory (e.g. ~/src), change directories to your new directory, check out the Debian Linux kernel source tree from the subversion repository, and install the build-dependencies

Changed lines 28-30 from:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src.

Change directory to the kernel source directory that was created, e.g.

to:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src. Note that the kernel tarball must have a version number x.y.z, not x.y.z.a, because the Debian patches apply against the original release of a particular kernel version (FIXME: update this text, what are the neames given to the x.y.z and x.y.z.a kernel versions and patches).

Changed lines 32-33 from:

$ cd linux-2.6-18

to:

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.tar.gz $ tar xzvf linux-2.6.18.tar.gz

Changed lines 36-40 from:

and create a symlink to the debian directory...

Then edit debian/arch/arm/config.ixp4xx as desired. Remember to make check the Kconfig dependencies.

Then compile the kernel using the following commands

to:

Change directory to the kernel source directory that was created, and create a symlink to the debian directory.

Changed lines 41-42 from:

$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

to:

$ cd linux-2.6-18 $ ln -s ../linux-2.6/debian debian

Changed lines 46-51 from:

The result will be a Debian package in your build directory (~/src/kernel) e.g.

to:

Now you are ready to make any changes to the kernel.

  • The kernel defconfig files are under debian/arch and are organized by archtecture (arm, i386, etc.) and flavour (e.g. for the arm architecture: iop32x, ixp4xx, etc.). Kernel config options for all architectures are in debian/arch/config.Remember to make check the Kconfig dependencies.
  • Kernel patches are found in debian/patches. and patch application is controled by the files in debian/patches/series/. The file names in this directory refer to the Debian kernel revision (?) number, and the patches listed in these files are applied in the order listed.

Once you are happy with your changes, compile the kernel using the following commands

Changed lines 55-56 from:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

to:

$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

Added lines 59-66:

The result will be a Debian package in your build directory (~/src/kernel) e.g. (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

(:tableend:)

Changed lines 75-76 from:

Adding NPE-B microcode to the Debian Installer image

to:

Adding NPE-B microcode to an existing Debian Installer image

Changed lines 79-80 from:

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm dialy images can be found at http://people.debian.org/~kmuto/d-i/images/daily/.

to:

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm daily images can be found at http://people.debian.org/~kmuto/d-i/images/daily/.

November 25, 2006, at 06:04 AM by dumfrac -- Add instructions to build the Debian kernel from trunk (not complete yet)
Changed lines 5-15 from:

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build.

Adding NPE-B microcode to the Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. This section documents the procedure to add the microcode to an existing Debian Installer image.

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm dialy images can be found at http://people.debian.org/~kmuto/d-i/images/daily/.

Unpack the image

to:

Build the Debian kernel (latest trunk version)

These instructions are not complete yet and will not work as is - this is a work in progress.

First, if want to compile the kernel on any machine other than an arm-based architecture, you need to build yourself a cross-compilation toolchain. There are several ways to do this, but I have found great instructions for Debian at http://wiki.debian.org/BuildingCrossCompilers. Note that every time gcc or binutils is updated, you will have to redo this procedure.

Others have noted that emDebian works well these days, and is apparently much less labor intensive.

Once you have a cross-compilation toolchain, create a directory (e.g. ~/src), change directories to your new directory, download the Debian linux-2.6 source from the subversion repository, and install the build-dependencies

Changed lines 17-20 from:

$ slugimage -u -i di-nslu2.bin

to:

$ mkdir ~/src $ cd ~/src $ svn co svn://svn.debian.org/svn/kernel/dists/trunk linux-2.6 $ sudo apt-get build-dep linux-2.6

Changed lines 24-26 from:

Endian swap the init ramdisk

to:

Download the appropriate kernel source tarball from http://www.kernel.org and unpack it in ~/src.

Change directory to the kernel source directory that was created, e.g.

Changed line 30 from:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

to:

$ cd linux-2.6-18

Changed lines 33-34 from:

Copy the microcode to the ramdisk

to:

and create a symlink to the debian directory...

Then edit debian/arch/arm/config.ixp4xx as desired. Remember to make check the Kconfig dependencies.

Then compile the kernel using the following commands

Changed lines 41-50 from:

$ su $ mkdir initrd $ cd initrd $ su -c 'zcat ../ramdisk-swap.gz | cpio -i' $ cd lib $ su -c 'mkdir firmware' $ cd firmware $ su -c 'cp <path to microcode>/NPE-B.01000201 .' $ su -c 'ln -s NPE-B.01000201 NPE-B' $ cd ..

to:

$ fakeroot debian/rules debian/build debian/stamps > ../kernel-build.log 2>&1 $ fakeroot make -f debian/rules.gen binary-arch-arm-none-ixp4xx >> ../kernel-build.log 2>&1

Changed line 46 from:

Copy the ethernet driver to the ramdisk (this step should be removed once the modules are added to the daily build)

to:

The result will be a Debian package in your build directory (~/src/kernel) e.g.

Changed lines 50-53 from:

$ cd modules/2.6.18-2-ixp4xx/kernel/drivers/net/ $ su -c 'mkdir ixp4xx' $ su -c 'cp <path to modules>/ixp4xx* ixp4xx/' $ cd ../../../../../..

to:

linux-image-2.6.18-3-ixp4xx_2.6.18-6_arm.deb

Changed lines 53-54 from:

Regenerate the ramdisk

to:

Copy this file to the slug and install the package.

Alternatively, use vmlinuz in ... and update-initramfs ... (complete these instructions).

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build.

Adding NPE-B microcode to the Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. This section documents the procedure to add the microcode to an existing Debian Installer image.

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm dialy images can be found at http://people.debian.org/~kmuto/d-i/images/daily/.

Unpack the image

Changed lines 71-72 from:

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz $ cd ..

to:

$ slugimage -u -i di-nslu2.bin

Changed line 75 from:

Pad to 4 MB and endian swap the new ramdisk

to:

Endian swap the init ramdisk

Changed lines 79-80 from:

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz $ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

to:

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

Changed line 83 from:

Create new di image

to:

Copy the microcode to the ramdisk

Changed lines 87-88 from:

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin $ sudo upslug2 -i di-nslu2-new.bin

to:

$ su $ mkdir initrd $ cd initrd $ su -c 'zcat ../ramdisk-swap.gz | cpio -i' $ cd lib $ su -c 'mkdir firmware' $ cd firmware $ su -c 'cp <path to microcode>/NPE-B.01000201 .' $ su -c 'ln -s NPE-B.01000201 NPE-B' $ cd ..

Added lines 99-136:

Copy the ethernet driver to the ramdisk (this step should be removed once the modules are added to the daily build) (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd modules/2.6.18-2-ixp4xx/kernel/drivers/net/
$ su -c 'mkdir ixp4xx'
$ su -c 'cp <path to modules>/ixp4xx* ixp4xx/'
$ cd ../../../../../..

(:tableend:)

Regenerate the ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
$ cd ..

(:tableend:)

Pad to 4 MB and endian swap the new ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz
$ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

(:tableend:)

Create new di image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin
$ sudo upslug2 -i di-nslu2-new.bin

(:tableend:)

November 25, 2006, at 05:29 AM by dumfrac -- Cleaned up information
Deleted lines 2-6:
   * Install Debian unstable
   * Check out the debian-installer source tree according to the instructions at
http://www.debian.org/devel/debian-installer/svn *
November 25, 2006, at 05:27 AM by dumfrac --
Changed lines 10-14 from:

Build Debian Installer

Instructions for building the Debian Installer can be found at
http://wiki.debian.org/DebianInstaller/Build.

to:

Build the Debian Installer

Instructions for building the Debian Installer can be found at http://wiki.debian.org/DebianInstaller/Build.

November 25, 2006, at 05:18 AM by dumfrac -- Add link to instructions for building the Debian Installer
Added lines 10-14:

Build Debian Installer

Instructions for building the Debian Installer can be found at
http://wiki.debian.org/DebianInstaller/Build.

November 24, 2006, at 06:18 AM by dumfrac --
Changed line 43 from:

$ su -c 'cp ../../../../npe/ixp4xx-npe/NPE-B.01000201 .'

to:

$ su -c 'cp <path to microcode>/NPE-B.01000201 .'

Changed line 49 from:

Copy the ethernet driver to the ramdisk

to:

Copy the ethernet driver to the ramdisk (this step should be removed once the modules are added to the daily build)

Changed line 55 from:

$ su -c 'cp /home/gordon/projects/nslu2/tmp/ixp4xx* ixp4xx/'

to:

$ su -c 'cp <path to modules>/ixp4xx* ixp4xx/'

November 24, 2006, at 05:01 AM by dumfrac --
Changed lines 4-5 from:
   * Check out the debian-installer source tree according to the instructions at\\ http://www.debian.org/devel/debian-installer/svn
to:
   * Check out the debian-installer source tree according to the instructions at
http://www.debian.org/devel/debian-installer/svn
November 24, 2006, at 05:00 AM by dumfrac --
Changed line 4 from:
   * Check out the debian-installer source tree according to the instructions at http://www.debian.org/devel/debian-installer/svn
to:
   * Check out the debian-installer source tree according to the instructions at\\ http://www.debian.org/devel/debian-installer/svn
November 24, 2006, at 01:41 AM by dumfrac -- Add section on adding the NPE-B microcode to the installer image
Changed lines 7-84 from:

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

to:

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

Adding NPE-B microcode to the Debian Installer image

The Intel NPE microcode is not DFSG compliant, and therefore cannot be distributed with the official Debian Installer images. This section documents the procedure to add the microcode to an existing Debian Installer image.

Locations of daily build images of the Debian Installer are at http://www.debian.org/devel/debian-installer. For example, arm dialy images can be found at http://people.debian.org/~kmuto/d-i/images/daily/.

Unpack the image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -u -i di-nslu2.bin

(:tableend:)

Endian swap the init ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ devio '<< ramdisk.gz; xp $ 4' > ramdisk-swap.gz

(:tableend:)

Copy the microcode to the ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ su
$ mkdir initrd
$ cd initrd
$ su -c 'zcat ../ramdisk-swap.gz | cpio -i'
$ cd lib
$ su -c 'mkdir firmware'
$ cd firmware
$ su -c 'cp ../../../../npe/ixp4xx-npe/NPE-B.01000201 .'
$ su -c 'ln -s NPE-B.01000201 NPE-B'
$ cd ..

(:tableend:)

Copy the ethernet driver to the ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ cd modules/2.6.18-2-ixp4xx/kernel/drivers/net/
$ su -c 'mkdir ixp4xx'
$ su -c 'cp /home/gordon/projects/nslu2/tmp/ixp4xx* ixp4xx/'
$ cd ../../../../../..

(:tableend:)

Regenerate the ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ find . | cpio --quiet -o -H newc | gzip -9 > ../new-ramdisk-swap.gz
$ cd ..

(:tableend:)

Pad to 4 MB and endian swap the new ramdisk (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ dd if=/dev/zero bs=1138877 count=1 2>/dev/null >> new-ramdisk-swap.gz
$ devio '<< new-ramdisk-swap.gz; xp $ 4' > new-ramdisk.gz

(:tableend:)

Create new di image (:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

$ slugimage -L apex.bin -r new-ramdisk.gz -k vmlinuz -p -o di-nslu2-new.bin
$ sudo upslug2 -i di-nslu2-new.bin

(:tableend:)

November 23, 2006, at 11:26 PM by rwhitby --
Changed lines 5-7 from:
   *
to:
   *

Debian developers, please flesh out this page. We want this page to be instructions for experienced nslu2-linux developers to build the absolute latest debian packages, kernel and installer for the nslu2-linux target devices (with the intention being to make it easy to add support to Debian for a new device, or a new kernel feature).

November 23, 2006, at 07:55 AM by rwhitby --
Changed lines 3-5 from:

+ Install Debian unstable + Check out the debian-installer source tree according to the instructions at http://www.debian.org/devel/debian-installer/svn +

to:
   * Install Debian unstable
   * Check out the debian-installer source tree according to the instructions at http://www.debian.org/devel/debian-installer/svn
   *
November 23, 2006, at 07:54 AM by rwhitby --
Added lines 1-5:

How to build a new Debian/NSLU2 image

+ Install Debian unstable + Check out the debian-installer source tree according to the instructions at http://www.debian.org/devel/debian-installer/svn +