Skip to content

Linux source for Allwinner/Boxchip F20 (sun3i), A10 (sun4i), A12/A13/A10S (sun5i) and A20 (sun7i) SoCs

License

Notifications You must be signed in to change notification settings

androportal/linux-sunxi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STEPS TO BUILD KERNEL FOR AAKASH

For original README, please see: README_kernel

COMPILE KERNEL

  1. Clone the repository by

    git clone https://github.com/androportal/linux-sunxi.git
    
  2. cd into linux-sunxi

    cd linux-sunxi
    
  3. Checkout to desired branch, it this case sunxi-3.4:

    git checkout sunxi-3.4
    
  4. Compile the a13_configuration(Optional, not required if you are using our config file)

    make ARCH=arm a13_defconfig
    
  5. Rename kernel config file

    cp -v config-3.4.79 .config
    
  6. A13-OLinuXino customization can be done using(Optional, if you have followed previous step(i.e you have .config file in kernel source), don't do this)

    make ARCH=arm menuconfig
    
  7. To compile kernel download and install Sourcery CodeBench Lite Edition, then issue:

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage
    
  8. To make kernel modules

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=out modules
    
  9. To install modules in right path

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=out modules_install
    
  10. After successful compilation, uImage will be available at arch/arm/boot/uImage and also find script.bin in the root of the directory(This section is subject to change), the kernel modules are available at out/lib/modules/3.4.79+/

Compile kernel in a clean way(Optional)

  1. If you want to keep the kernel source clean and have a kernel build in a separate directory, follow this steps.

  2. Assuming you have downloaded the kernel, and you have .config file in the source tree, make a separate directory build outside the kernel source. For example, if the kernel source is in the path ~/kernel/linux-sunxi, create build directory in ~/kernel/

    mkdir ~/kernel/build
    
  3. Now move .config file in build path

    mv -v ~/kernel/linux-sunxi/.config ~/kernel/build/
    
  4. Now specify the build directory path to make

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage O=~/kernel/build
    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- O=~/kernel/build INSTALL_MOD_PATH=out modules
    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- O=~/kernel/build INSTALL_MOD_PATH=out modules_install
    
  5. Now your uImage file will be compiled inside ~/kernel/build/arch/arm/boot directory and all your modules will be placed inside ~/kernel/build/out directory.

KERNEL ON SDCARD

  1. Insert sdcard in card reader or MMC reader available in laptops/netbooks

  2. 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 machine:

    sudo fdisk -u=sectors /dev/sdX
    
  3. Then create partition for kernel and filesystem in your sdcard, from inside fdisk prompt type p to list all partitions

    Command (m for help): p
    
  4. Now press d to delete your partition. If you have multiple partitions use partition number to delete each partition as shown by fdisk utility:

    Command (m for help): d
    
  5. Type n for new partion(hit enter) and then mention p 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 kernel:

    Command (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
    
  6. 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
    
  7. (Optional) If you intend to use swap partion, leave atleast ~300MB in previous step and create a 3rd primary partition.

  8. 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
    
  9. 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
    
  10. 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 in linux-sunxi directory:

    sudo cp arch/arm/boot/uImage /mnt/boot
    

    Also copy script.bin to same directory:

    sudo cp script.bin /mnt/boot
    

    Now, umount /mnt/boot, before that you may want to sync so that any remaining buffers are written to disks:

    sudo sync
    

    Finally unmount:

    sudo umount /mnt/boot
    

At this point we have a sdcard readly with kernel. Burn uboot and copy rootfs to make a usuable Linux for your tablet.

About

Linux source for Allwinner/Boxchip F20 (sun3i), A10 (sun4i), A12/A13/A10S (sun5i) and A20 (sun7i) SoCs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 94.5%
  • Objective-C 1.9%
  • Assembly 1.8%
  • C++ 1.7%
  • Perl 0.1%
  • Shell 0.0%