Welcome! Log In Create A New Profile

Advanced

How to compile the kernel on the DockStar itself?

Posted by Val532 
How to compile the kernel on the DockStar itself?
January 09, 2012 03:05PM
hi,

I want to compile the linux kernel on the dockstar ?

i can "make zImage" and "make modules" but i can build a *.deb with make-kpkg.

how i can do it ?

(it's for build a kernel for my mss2 on my dockstar, because i do not have a linux x86 to cross compile)

thanks.
eas
Re: How to compile the kernel on the DockStar itself?
January 11, 2012 06:15PM
I don't see a reason you can't just follow the generic debian instructions for building a new kernel package:

http://www.debian.org/releases/stable/i386/ch08s06.html.en
Re: How to compile the kernel on the DockStar itself?
January 11, 2012 10:00PM
When i try to made it, i have an error like arm-none-linux-gnueabi-lb.

But if i do make-kpkg on arm ,I should not have this error ? no ?

(sory I'm french and my english is not very good)
Re: How to compile the kernel on the DockStar itself?
January 16, 2012 07:20PM
@Val523, its not that hard... I just rolled my own 3.1.9 linux-image .deb package on my spare Dockstar
root@sparedockstar:~# uname -a
Linux debian 3.1.9-kirkwood #1 Mon Jan 16 13:45:21 UTC 2012 armv5tel GNU/Linux
... you'll have to adjust it to your needs and version... but ...

make sure you have all the necessary compile/make/dpkg-build packages installed via apt-get :
apt-get install apt-utils build-essential dialog fakeroot flash-kernel git-core gzip initramfs-tools kernel-package libncurses5-dev lzma  uboot-mkimage
(there are probably some extra ones in there...)

Get the source and put it in the expected place, unpack it:
cd /usr/src/
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.1.9.tar.bz2   # adjust to your desired version
tar xjvf linux-3.1.9.tar.bz2

Get a known good working kernel config, and adjust it to your needs... I used the generic config in /boot from Wheezy's 3.1.0-1, and altererd it to make it a little bit smaller...
cp <whatever-config-you-want-to-start-with>   linux-3.1.9/.config          # you can start with a default kirkwood config and build up, ... or whatever
make menuconfig        #turn on what you need, turn off what you _know_ you'll never need...
When you save it while exiting from the menuconfig, check for errors... adjust and repeat as necessary...

Compile and create the .deb files for linux-image and linux-headers
make-kpkg --rootcmd fakeroot --arch armel  --append-to-version=-kirkwood --revision=1.0 --initrd kernel_image kernel_headers
... wait about 2 hours.


Install and create uBoot-ready uImage & initrd files:
dpkg -i /usr/src/linux-image-3.1.9-kirkwood_1.0_armel.deb 

mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-3.1.9-kirkwood -d /boot/vmlinuz-3.1.9-kirkwood /boot/uImage

mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-3.1.9-kirkwood -d /boot/initrd.img-3.1.9-kirkwood /boot/uInitrd


These are the commands I used to make a 3.1.9 kernel package - you'd have to adjust as needed to your intents... good luck.

My kernel package for linux-image-3.1.9-kirkwood_1.0_armel.deb : http://ppl.ug/cnl1R63ZOBM/ ---make sure you back up your /boot dir and other essentials before using this... also use @ your own risk...
the Linux header package is here : http://ppl.ug/vhmCIjv6zmk/

=====================================================



Edited 4 time(s). Last edit at 01/16/2012 08:53PM by davygravy.
Re: How to compile the kernel on the DockStar itself?
January 17, 2012 09:52AM
Thank you,
I will test it in some hours to see if I still have the same error.
Re: How to compile the kernel on the DockStar itself?
March 28, 2012 04:57PM
davygravy Wrote:
-------------------------------------------------------
> Compile and create the .deb files for linux-image
> and linux-headers
>
> make-kpkg --rootcmd fakeroot --arch armel 
> --append-to-version=-kirkwood --revision=1.0
> --initrd kernel_image kernel_headers
> 
... wait about 2 hours.

The trick is to specify --arch; although the documentation specifies you shouldn't specify this unless you're cross compiling, make-kpkg will assume you're cross compiling anyway.

Thanks!
Re: How to compile the kernel on the DockStar itself?
April 01, 2012 04:15PM
Hi guys,

My Pogoplug Pink is currently

Linux Debian 3.1.9-kirkwood #1 Mon Jan 16 13:45:21 UTC 2012 armv5tel GNU/Linux

I'm trying to compile debian using this source:
http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.1.10.tar.bz2

I copied the config file from the current /boot directory to /usr/src/.config
/boot/config-3.1.9-kirkwood

and did not change anything related to processor type,

And I kept getting this error:

root@Debian:/usr/src/linux-3.1.10# make-kpkg --rootcmd fakeroot --arch armel  --append-to-version=-kirkwood --revision=1.0 --initrd kernel_image kernel_headers
exec make kpkg_version=12.036+nmu2 -f /usr/share/kernel-package/ruleset/minimal.mk debian DEBIAN_REVISION=1.0  APPEND_TO_VERSION=-kirkwood  KPKG_ARCH=armel   INITRD=YES  ROOT_CMD=fakeroot 
====== making target debian/stamp/conf/minimal_debian [new prereqs: ]======
This is kernel package version 12.036+nmu2.
test -d debian             || mkdir debian
test ! -e stamp-building || rm -f stamp-building
install -p -m 755 /usr/share/kernel-package/rules debian/rules
for file in ChangeLog  Control  Control.bin86 config templates.in rules; do                                      \
            cp -f  /usr/share/kernel-package/$file ./debian/;                               \
        done
for dir  in Config docs examples ruleset scripts pkg po;  do                                      \
          cp -af /usr/share/kernel-package/$dir  ./debian/;                                 \
        done
test -f debian/control || sed         -e 's/=V/..-kirkwood/g'  \
                -e 's/=D/1.0/g'         -e 's/=A/armel/g'  \
		-e 's/=SA//g'  \
		-e 's/=I//g'				    \
		-e 's/=CV/./g'			    \
		-e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/g'			    \
		-e 's/=ST/linux/g'      -e 's/=B/armel/g'    \
                  /usr/share/kernel-package/Control > debian/control
test -f debian/changelog ||  sed -e 's/=V/..-kirkwood/g'       \
            -e 's/=D/1.0/g'        -e 's/=A/armel/g'       \
            -e 's/=ST/linux/g'     -e 's/=B/armel/g'         \
            -e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/g'                            \
             /usr/share/kernel-package/changelog > debian/changelog
chmod 0644 debian/control debian/changelog
test -d ./debian/stamp || mkdir debian/stamp 
make -f debian/rules debian/stamp/conf/kernel-conf
make[1]: Entering directory `/usr/src/linux-3.1.10'
debian/ruleset/misc/checks.mk:36: *** Error. I do not know where the kernel image goes to [kimagedest undefined] The usual case for this is that I could not determine which arch or subarch this machine belongs to. Please specify a subarch, and try again..  Stop.
make[1]: Leaving directory `/usr/src/linux-3.1.10'
make: *** [debian/stamp/conf/minimal_debian] Error 2
Failed to create a ./debian directory: No such file or directory at /usr/bin/make-kpkg line 984.

The error seems to be a catchall kind of error. ... Any idea why?

Addendum:

Leaving out the --arch armel seems to do the trick in this case! It's compiling with this command:
make-kpkg --rootcmd fakeroot --append-to-version=-kirkwood --revision=1.0 --initrd kernel_image kernel_headers

Thanks,
bodhi



Edited 1 time(s). Last edit at 04/01/2012 05:45PM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: