-
Notifications
You must be signed in to change notification settings - Fork 23
Compiling kernel
-
Steps to build kernel
-
Clone the repository by
git clone https://github.com/androportal/linux-sunxi.git
-
cd
intolinux-sunxi
cd linux-sunxi
-
Checkout to desired branch, it this case
sunxi-3.0
:git checkout sunxi-3.0
-
Compile the a13_configuration
make ARCH=arm a13_defconfig
-
Download the latest .config file from here and keep it in the root of the kernel source code directory (change the downloaded config file back to .config)
-
A13-OLinuXino customization can be done using(optional)
make ARCH=arm menuconfig
-
To compile kernel download and install
Sourcery CodeBench Lite Edition
, then issuemake ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage
-
To make kernel modules
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=out modules
-
To install modules in right path
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=out modules_install
-
After successful compilation
uImage
will be available atarch/arm/boot/uImage
and also findscript.bin
in the root of the directory(This section is subject to change), the kernel modules are available atout/lib/modules/3.0.42+/
-
-
Kernel on SDcard
-
Insert
sdcard
in card reader or MMC reader available in laptops/netbooks -
Backup all your sdcard data, and issue the following commands carefully, replace X in /dev/sdX with suitable letter(a lower case alphabet) alloted for your sdcard, remember X will never be a if you have a hard disk installed, so keep in mind it must be something like
/dev/sdb
or /dev/sdc
etc. Please check twice and if you are still unsure leave this README right now otherwise you may end up with non bootable machinesudo fdisk -u=sectors /dev/sdX
-
Then create partition for kernel and filesystem in your sdcard, from inside
fdisk
prompt typep
to list all partitionsCommand (m for help): p
-
Now press
d
to delete your partition. If you have multiple partitions use partition number to delete each partition as shown by fdisk utilityCommand (m for help): d
-
Type
n
for new partion(hit enter) and then mentionp
for primary partition, hit enter to continue with default starting sector(2048), enter again for last sector and mention+16M
, this partition will be later formatted with vfat for kernelCommand (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): Using default value 1 First sector (2048-7744511, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-7744511, default 7744511): +16M
-
The sdcard is assumed to be 4gb size, similarly create 2nd primary partition using remaining disk space which will serve as filesystem
Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (1-4, default 2): Using default value 2 First sector (34816-7744511, default 34816): Using default value 34816 Last sector, +sectors or +size{K,M,G} (34816-7744511, default 7744511): Using default value 7744511
-
Now as we have created 2 primary partitions now let's write(w) the changes to disk. For that issue
Command (m for help): w
-
As partition is completed, we need to format them respectively, the first partition must be vfat so that uboot can read kernel
sudo mkfs.vfat /dev/sdX1
For rootfs, create ext4 partition
sudo mkfs.ext4 /dev/sdX2
-
Now mount vfat partition to some mount point(directory)
sudo mount -t vfat /dev/sdX1 /mnt/boot
copy kernel to
/mnt/boot
, assuming that you are still inlinux-sunxi
directorysudo cp arch/arm/boot/uImage /mnt/boot
Also copy
script.bin
to same directorysudo cp script.bin /mnt/boot
Now, umount /mnt/boot, before that you may want to
sync
so that any remaining buffers are written to diskssudo sync
Finally unmount:
sudo umount /mnt/boot
At this point we have a sdcard read with kernel. Burn
uboot
and copyrootfs
to make a usuable Linux for your tablet.
-