Kernel compiling

From odroid US
Revision as of 11:58, 11 January 2013 by Sebastian s (Talk | contribs)

Jump to: navigation, search

WATCH THE SIZE OF YOUR BOOT PARTITION, MAYBE YOU HAVE TO DELETE SOME OF THE BACKUP FILES!

DO THIS ON YOUR ODROID, NOT ON YOUR PC!

you can easily build the kernel on your own:

wget https://github.com/hardkernel/linux/archive/odroid-3.0.y.zip
mv odroid-3.0.y.zip /usr/src/linux.zip
apt-get install p7zip-full
cd /usr/src
7z x -y linux.zip > /dev/null
mv linux-odroid* linux
cd linux

make sure to select the right config for your device in the next step. execute the following to get a list of odroid kernel configs:

ls /usr/src/linux/arch/arm/configs/ | grep odroid

now choose your config and copy it to /usr/src/linux/.config (i chose odroid-x2s ubuntu config)

cp arch/arm/configs/odroidx2_ubuntu_defconfig /usr/src/linux/.config

Text mode:

apt-get install ncurses-dev
make menuconfig

Graphical mode:

apt-get install qt4-dev-tools
make xconfig

change everything to your needs (use / for searching)

make -j8
make modules_install
make zImage
kernelversion=`cat ./include/config/kernel.release`
mount -o bind /media/boot/ /boot
cp /media/boot/zImage /media/boot/zImage.prev
cp /media/boot/uInitrd /media/boot/uInitrd.prev
cp arch/arm/boot/zImage /media/boot
cp .config /boot/config-$kernelversion

optionally:

cp System.map /boot/System.map-$kernelversion

NOT optional:

mkinitramfs -c gzip -o ./initramfs-$kernelversion $kernelversion
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initramfs-$kernelversion ./uInitrd
cp uInitrd /media/boot

halt:

shutdown -h 0

power cycle after that.