Build the Linux kernel

How to build a Linux kernel and flash it to the phone

Since the launch of the unlock boot loader site, we have received a lot of really great feedback. The Sony Ericsson Developer Program wants to continue to build on this open dialogue with external developers.

Developers and advanced users can now unlock the boot loader, which is the first step to be able to flash your own image. Now we have seen quite a few comments in different forums like the XDA forum, where developers run into problems when building their own image, and and trying to flash the image using Fastboot. With the help of our Master Software Architect, James Jacobsson, we put together a short article on how to do this.

Before moving on, we’d like to remind you again that there is no turning back when unlocking the boot loader. You may void the warranty of the phone, and you will not be able to revert the phone to a locked or original state if you unlock it.

What is the Linux kernel?
The Xperia™ line of smartphones run on the Android™, the mobile operating system based on the Linux kernel. Though it is only a small part of the operating system, the kernel ensures that all other processes in the system are synchronized to work together properly.

Why rebuild the kernel?
Rebuilding the kernel enables end users to make modifications to their devices that are normally not intended by the device manufacturer, such as theming the device by changing system icons and removing/modifying system components. Please note that Sony Ericsson is not recommending this.

Considerations before building your own kernel and reflashing your device
As mentioned in the beginning of this article, the first step is to unlock the boot loader. When the boot loader is unlocked, the sensitive data is removed, such as DRM certificates, and the user partition of the file system is wiped out. But all other functionality, such as the camera and other drivers, is left intact. Please note that content, like music files, that require the DRM certificate will not be accessible any more. But most importantly, you may void the warranty of your phone if you decide to unlock it. Aside from the considerations mentioned above, the functionality is there, just waiting for you to take advantage of it. So, if you’re ready, here’s how to get started.

Building the kernel
It takes a few main steps to build the kernel. Below we’ll show you how to build a Linux kernel and flash it onto the device.

Step A – Download the necessary software
Download the following software to get started:

  • The kernel source code can be downloaded from the copyleft archives on Sony Ericsson Developer World. You can use the file called 3.0.A.2.181_182.tar.bz2 for our Android™ Gingerbread devices. This is the source code for the Linux kernel as used in the Xperia™ PLAY.
  • The Fastboot client which is part of the Android SDK. This is the standard Android flashing utility. This allows you to flash the image you are about to create onto the device.
  • The Init RAM disk. The initial RAM disk (also known as the initrd) is the initial filesystem that the kernel will mount and start running processes off. You can configure the Init RAM disk to grant root access. How you create or download your own Init RAM disk is beyond the scope of this article.
  • The ARM cross-compiler. A cross-compiler is used to build ARM binaries on a different architecture, such as x86. This allows you to compile software (such as the kernel) into a format that the device can run. We recommend getting the CodeSourcery Lite compiler, especially the GNU/Linux variant, as you’ll need that if you want to build binaries for a full-blown Linux system on the device later. However, any EABI ARM compiler capable of compiling the Linux kernel should be enough for this step.

Step B – Building the kernel
To build the kernel, you first need to unpack the kernel. Once you’ve unpacked the kernel, you need to configure it, and then build it. The example below is based on you using the file called 3.0.A.2.181_182.tar.bz2.

1. Go into the kernel directory:

cd kernel

2. Configure the kernel:
ARCH=arm CROSS_COMPILE=/opt/arm-2010q1/bin/arm-none-eabi- make semc_zeus_defconfig

Note: Replace:
/opt/arm-2010q1

with where you installed your cross-compiler. Also, this example is for Xperia™ PLAY. Replace:
defconfig

with the following values depending on what device you want to configure it for:

Xperia™ PLAY semc_zeus_defconfig
Xperia™ arc semc_anzu_defconfig
Xperia™ neo semc_hallon_defconfig

3. Build the kernel:

ARCH=arm CROSS_COMPILE=/opt/arm-2010q1/bin/arm-none-eabi- make

Replace:
/opt/arm-2010q1

with where you installed your cross-compiler. Once done, you should have a compressed kernel-image in arch/arm/boot/zImage.

Step C – Getting a RAM disk
The RAM disk is the initial filesystem the kernel will mount before transferring control to userspace. How you create your own root filesystem is beyond the scope of this article, but you can use the following instructions to pack/unpack the file.

Unpacking (you have ramdisk.img, and want to create a directory of files out of it):

gzip -d - < ramdisk.img > cpio -idm

Packing (You have directory of files, and want to create ramdisk.img from it):
find . | cpio --quiet -H newc -o | gzip > ramdisk.img

Step D – Assembling the boot.img
Now that we have all the parts we need to create a flashable file. The next stop is to package the parts. To do this, you’ll need the program mkbootimg, which is part of the standard Android tree. If you don’t feel like compiling all of Android to get this tool, it is available to download from various trusted sites on the Internet.

Once you have the tool, this is the command to combine your kernel and RAM disk into a flashable file:

mkbootimg --base 0x00200000 --kernel kernel/arch/arm/boot/zImage --ramdisk ramdisk.img -o boot.img

Step E – Flashing the file
You should flash the file using Fastboot. If you’ve unlocked the boot loader on your device, you already have Fastboot.

1. To flash the boot.img file, use the following the command:

fastboot –i 0x0fce flash boot boot.img

2. Now, it will prompt you to connect your device. To do so, follow these simple steps:

  1. Make sure your device is powered down.
  2. Hold down the Search button (Xperia™ PLAY only) or the Back button (all other Xperia™ devices). The device’s notification light should shine blue to confirm it’s in Fastboot mode.
  3. Connect the USB cable.
  4. Flashing should now start and complete.

3. As a last step in the process, you need to reboot the device. You can either remove the USB cable and battery to power the device down. If you prefer, you can instead issue the following command (either method will work):

fastboot –i 0x0fce reboot

Important information!
Sony Ericsson does not guarantee any support on this, but we will monitor the Building the Linux kernel for Xperia phones thread on the XDA Developers forum. However, we cannot guarantee an answer for every question asked in this forum.

Additional information for experienced Linux kernel experts
The kernel is pretty standard, all the regular things you’re used to is there, and available to use. Things that are different are the memory config and the kernel commandline. The memory config is hardcoded (i.e., ATAGs aren’t used for this). It’s set in the board-file for your target, such as kernel/arch/arm/mach-msm/board-semc_zeus.c in the function msm7x30_fixup. The kernel commandline is also not fetched from the boot.img file, but compiled into the kernel (CONFIG_CMDLINE). Some arguments are also added from the boot loader.

Additional information if porting non-Linux format files to the device
The boot loader will accept any reasonably formatted boot.img file. For example, at the Android Kernel Git, you will see the format of the boot.img file. This allows you to create a boot.img file containing two loadable files (kernel+ramdisk), which will get loaded into RAM. Once the boot loader is loaded, it passes the control to the first instruction of the loaded kernel image. After control is passed, the kernel can rely on the data contained in the RAM disk already being loaded.

More information: 

Comments 90

Sort by: Newest | Oldest | Most popular

  1. By Raphael Stroe

    #1

    $ make ARCH=arm CROSS_COMPILE=/home/raphael/arm2010q/bin/arm-none-linux-gnueabi-
    include/config/auto.conf: line 539: KERNEL_LOCAL_VERSION: command not found
    CHK include/linux/version.h
    CHK include/generated/utsrelease.h
    make[1]: `include/generated/mach-types.h’ is up to date.
    CALL scripts/checksyscalls.sh
    sed: can’t read scripts/../arch/x86/include/asm/unistd_32.h: No such file or directory
    CC init/main.o
    CHK include/generated/compile.h
    UPD include/generated/compile.h
    CC init/version.o
    CC init/do_mounts.o
    CC init/do_mounts_initrd.o
    LD init/mounts.o
    CC init/initramfs.o
    CC init/calibrate.o
    LD init/built-in.o
    GEN usr/initramfs_data.cpio
    AS usr/initramfs_data.o
    LD usr/built-in.o
    CC arch/arm/vfp/vfpmodule.o
    AS arch/arm/vfp/entry.o
    AS arch/arm/vfp/vfphw.o
    CC arch/arm/vfp/vfpsingle.o
    CC arch/arm/vfp/vfpdouble.o
    LD arch/arm/vfp/vfp.o
    LD arch/arm/vfp/built-in.o
    CC arch/arm/kernel/elf.o
    AS arch/arm/kernel/entry-armv.o
    AS arch/arm/kernel/entry-common.o
    CC arch/arm/kernel/irq.o
    CC arch/arm/kernel/process.o
    CC arch/arm/kernel/ptrace.o
    CC arch/arm/kernel/return_address.o
    arch/arm/kernel/return_address.c:62: warning: #warning “TODO: return_address should use unwind tables”
    CC arch/arm/kernel/setup.o
    CC arch/arm/kernel/signal.o
    CC arch/arm/kernel/sys_arm.o
    CC arch/arm/kernel/stacktrace.o
    CC arch/arm/kernel/time.o
    CC arch/arm/kernel/traps.o
    CC arch/arm/kernel/armksyms.o
    CC arch/arm/kernel/module.o
    AS arch/arm/kernel/sleep.o
    CC arch/arm/kernel/sched_clock.o
    CC arch/arm/kernel/sys_oabi-compat.o
    CC arch/arm/kernel/thumbee.o
    CC arch/arm/kernel/unwind.o
    CC arch/arm/kernel/pmu.o
    CC arch/arm/kernel/perf_event.o
    CC arch/arm/kernel/io.o
    AS arch/arm/kernel/debug.o
    CC arch/arm/kernel/early_printk.o
    CC arch/arm/kernel/fih_sw_info.o
    LD arch/arm/kernel/built-in.o
    AS arch/arm/kernel/head.o
    CC arch/arm/kernel/init_task.o
    LDS arch/arm/kernel/vmlinux.lds
    CC arch/arm/mm/dma-mapping.o
    CC arch/arm/mm/extable.o
    CC arch/arm/mm/fault.o
    CC arch/arm/mm/init.o
    CC arch/arm/mm/iomap.o
    CC arch/arm/mm/fault-armv.o
    CC arch/arm/mm/flush.o
    CC arch/arm/mm/idmap.o
    CC arch/arm/mm/ioremap.o
    CC arch/arm/mm/mmap.o
    CC arch/arm/mm/pgd.o
    CC arch/arm/mm/mmu.o
    CC arch/arm/mm/vmregion.o
    CC arch/arm/mm/proc-syms.o
    CC arch/arm/mm/alignment.o
    CC arch/arm/mm/highmem.o
    AS arch/arm/mm/abort-ev7.o
    AS arch/arm/mm/pabort-v7.o
    AS arch/arm/mm/cache-v7.o
    CC arch/arm/mm/copypage-v6.o
    CC arch/arm/mm/context.o
    AS arch/arm/mm/tlb-v7.o
    AS arch/arm/mm/proc-v7.o
    CC arch/arm/mm/cache-l2x0.o
    LD arch/arm/mm/built-in.o
    CC arch/arm/common/cpaccess.o
    LD arch/arm/common/built-in.o
    CC arch/arm/mach-msm/io.o
    CC arch/arm/mach-msm/dma.o
    CC arch/arm/mach-msm/memory.o
    CC arch/arm/mach-msm/timer.o
    CC arch/arm/mach-msm/clock.o
    CC arch/arm/mach-msm/clock-voter.o
    CC arch/arm/mach-msm/clock-dummy.o
    CC arch/arm/mach-msm/modem_notifier.o
    CC arch/arm/mach-msm/subsystem_map.o
    CC arch/arm/mach-msm/cpufreq.o
    CC arch/arm/mach-msm/nohlt.o
    CC arch/arm/mach-msm/clock-debug.o
    CC arch/arm/mach-msm/proc_comm.o
    CC arch/arm/mach-msm/clock-pcom.o
    CC arch/arm/mach-msm/mpp.o
    CC arch/arm/mach-msm/footswitch-pcom.o
    CC arch/arm/mach-msm/pmic_debugfs.o
    CC arch/arm/mach-msm/acpuclock.o
    CC arch/arm/mach-msm/acpuclock-7201.o
    CC arch/arm/mach-msm/pmu.o
    CC arch/arm/mach-msm/irq-vic.o
    AS arch/arm/mach-msm/idle-v7.o
    CC arch/arm/mach-msm/smem_log.o
    CC arch/arm/mach-msm/smd.o
    CC arch/arm/mach-msm/smd_debug.o
    CC arch/arm/mach-msm/remote_spinlock.o
    CC arch/arm/mach-msm/socinfo.o
    CC arch/arm/mach-msm/pmic.o
    CC arch/arm/mach-msm/rpc_hsusb.o
    CC arch/arm/mach-msm/rpc_pmapp.o
    CC arch/arm/mach-msm/rpc_fsusb.o
    CC arch/arm/mach-msm/nand_partitions.o
    CC arch/arm/mach-msm/smd_tty.o
    CC arch/arm/mach-msm/smd_pkt.o
    CC arch/arm/mach-msm/smd_rpcrouter.o
    CC arch/arm/mach-msm/smd_rpcrouter_device.o
    CC arch/arm/mach-msm/smd_rpc_sym.o
    CC arch/arm/mach-msm/smd_rpcrouter_servers.o
    CC arch/arm/mach-msm/smd_rpcrouter_clients.o
    CC arch/arm/mach-msm/smd_rpcrouter_xdr.o
    CC arch/arm/mach-msm/rpcrouter_smd_xprt.o
    CC arch/arm/mach-msm/ping_mdm_rpc_client.o
    CC arch/arm/mach-msm/proc_comm_test.o
    CC arch/arm/mach-msm/ping_apps_server.o
    CC arch/arm/mach-msm/oem_rapi_client.o
    CC arch/arm/mach-msm/rpc_server_dog_keepalive.o
    CC arch/arm/mach-msm/dal.o
    CC arch/arm/mach-msm/dal_axi.o
    CC arch/arm/mach-msm/qdsp5/adsp.o
    CC arch/arm/mach-msm/qdsp5/adsp_driver.o
    CC arch/arm/mach-msm/qdsp5/adsp_info.o
    CC arch/arm/mach-msm/qdsp5/adsp_rm.o
    CC arch/arm/mach-msm/qdsp5/dsp_debug.o
    CC arch/arm/mach-msm/qdsp5/adsp_debug.o
    CC arch/arm/mach-msm/qdsp5/adsp_video_verify_cmd.o
    CC arch/arm/mach-msm/qdsp5/adsp_videoenc_verify_cmd.o
    CC arch/arm/mach-msm/qdsp5/adsp_jpeg_verify_cmd.o
    CC arch/arm/mach-msm/qdsp5/adsp_jpeg_patch_event.o
    CC arch/arm/mach-msm/qdsp5/adsp_vfe_verify_cmd.o
    CC arch/arm/mach-msm/qdsp5/adsp_vfe_patch_event.o
    CC arch/arm/mach-msm/qdsp5/adsp_lpm_verify_cmd.o
    CC arch/arm/mach-msm/qdsp5/audio_pcm_in.o
    CC arch/arm/mach-msm/qdsp5/audio_voice_lb.o
    CC arch/arm/mach-msm/qdsp5/audio_aac_in.o
    CC arch/arm/mach-msm/qdsp5/audio_evrc_in.o
    CC arch/arm/mach-msm/qdsp5/audio_qcelp_in.o
    CC arch/arm/mach-msm/qdsp5/audio_out.o
    CC arch/arm/mach-msm/qdsp5/audio_mp3.o
    CC arch/arm/mach-msm/qdsp5/audmgr.o
    CC arch/arm/mach-msm/qdsp5/audpp.o
    CC arch/arm/mach-msm/qdsp5/audrec.o
    CC arch/arm/mach-msm/qdsp5/audpreproc.o
    CC arch/arm/mach-msm/qdsp5/audio_evrc.o
    CC arch/arm/mach-msm/qdsp5/audio_qcelp.o
    CC arch/arm/mach-msm/qdsp5/audio_amrnb.o
    CC arch/arm/mach-msm/qdsp5/audio_aac.o
    CC arch/arm/mach-msm/qdsp5/audio_amrnb_in.o
    CC arch/arm/mach-msm/qdsp5/audio_wma.o
    CC arch/arm/mach-msm/qdsp5/audio_voicememo.o
    CC arch/arm/mach-msm/qdsp5/audio_pcm.o
    CC arch/arm/mach-msm/qdsp5/audio_amrwb.o
    CC arch/arm/mach-msm/qdsp5/audio_wmapro.o
    CC arch/arm/mach-msm/qdsp5/snd.o
    CC arch/arm/mach-msm/qdsp5/snd_adie.o
    CC arch/arm/mach-msm/qdsp5/audio_fm.o
    CC arch/arm/mach-msm/qdsp5/audio_mvs.o
    CC arch/arm/mach-msm/qdsp5/fih_headset.o
    LD arch/arm/mach-msm/qdsp5/built-in.o
    CC arch/arm/mach-msm/pm-boot.o
    CC arch/arm/mach-msm/pm2.o
    CC arch/arm/mach-msm/dma_test.o
    CC arch/arm/mach-msm/keypad-surf-ffa.o
    CC arch/arm/mach-msm/clock-pcom-lookup.o
    CC arch/arm/mach-msm/board-tamsui-mesona.o
    CC arch/arm/mach-msm/devices-tamsui-mesona.o
    CC arch/arm/mach-msm/rmt_storage_client.o
    CC arch/arm/mach-msm/gpiomux-7×27.o
    CC arch/arm/mach-msm/gpiomux-v1.o
    CC arch/arm/mach-msm/gpiomux.o
    CC arch/arm/mach-msm/gpio.o
    CC arch/arm/mach-msm/btpintest.o
    CC arch/arm/mach-msm/msm_vibrator.o
    CC arch/arm/mach-msm/proccomm-regulator.o
    CC arch/arm/mach-msm/board-msm7x27a-regulator.o
    CC arch/arm/mach-msm/fih_proc_fs.o
    arch/arm/mach-msm/fih_proc_fs.c:8: fatal error: ../../../../Version_LINUX.h: No such file or directory
    compilation terminated.
    make[1]: *** [arch/arm/mach-msm/fih_proc_fs.o] Error 1
    make: *** [arch/arm/mach-msm] Error 2

    I’ve tried even with NDK toolchain… still same error..

  2. By Jebanaciasnota Uyyg

    #2

    drivers/spi/amba-pl022.c:1401:20: warning: variable ‘chip’ set but not used [-Wunused-but-set-variable]
    LD drivers/spi/built-in.o
    CC drivers/staging/staging.o
    CC drivers/staging/android/binder.o
    CC drivers/staging/android/logger.o
    CC drivers/staging/android/ram_console.o
    CC drivers/staging/android/timed_output.o
    CC drivers/staging/android/timed_gpio.o
    CC drivers/staging/android/lowmemorykiller.o
    CC drivers/staging/android/ste_timed_vibra.o
    LD drivers/staging/android/built-in.o
    CC drivers/staging/mmio/st_mmio.o
    drivers/staging/mmio/st_mmio.c: In function ‘mmio_enable_xshutdown_from_host’:
    drivers/staging/mmio/st_mmio.c:434:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
    LD drivers/staging/mmio/built-in.o
    CC drivers/staging/nmf-cm/cm/engine/dsp/src/dsp.o
    drivers/staging/nmf-cm/cm/engine/dsp/src/dsp.c: In function ‘cm_DSP_AcknowledgeDspIrq’:
    drivers/staging/nmf-cm/cm/engine/dsp/src/dsp.c:315:5: error: variable ‘dummy’ set but not used [-Werror=unused-but-set-variable]
    cc1: all warnings being treated as errors
    make[3]: *** [drivers/staging/nmf-cm/cm/engine/dsp/src/dsp.o] Błąd 1
    make[2]: *** [drivers/staging/nmf-cm] Błąd 2
    make[1]: *** [drivers/staging] Błąd 2
    make: *** [drivers] Błąd 2
    root@kubuntu:/home/kubuntu/Desktop/6_0_B_1_564_tar/kernel# ^C

    ideas?

  3. By steve William

    #5

    I have been trying to compile the 4.1.B.1.13 kernel for the Ray but have been having issues with missing files like connmark.c and the following errors:
    net/ipv4/netfilter/ipt_ecn.c: In function ‘match_ip’:
    net/ipv4/netfilter/ipt_ecn.c:28:29: error: ‘XT_DSCP_MASK’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:28:29: note: each undeclared identifier is reported only once for each function it appears in
    net/ipv4/netfilter/ipt_ecn.c:28:54: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c: At top level:
    net/ipv4/netfilter/ipt_ecn.c:33:9: warning: ‘struct ipt_ecn_info’ declared inside parameter list [enabled by default]
    net/ipv4/netfilter/ipt_ecn.c: In function ‘match_tcp’:
    net/ipv4/netfilter/ipt_ecn.c:47:11: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:47:25: error: ‘IPT_ECN_OP_MATCH_ECE’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:48:12: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:57:11: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:57:25: error: ‘IPT_ECN_OP_MATCH_CWR’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:58:12: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c: In function ‘ecn_mt’:
    net/ipv4/netfilter/ipt_ecn.c:74:10: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:74:24: error: ‘IPT_ECN_OP_MATCH_IP’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:75:3: warning: passing argument 2 of ‘match_ip’ from incompatible pointer type [enabled by default]
    net/ipv4/netfilter/ipt_ecn.c:25:20: note: expected ‘const struct ipt_ecn_info *’ but argument is of type ‘const struct ipt_ecn_info *’
    net/ipv4/netfilter/ipt_ecn.c:78:10: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:78:25: error: ‘IPT_ECN_OP_MATCH_ECE’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:78:46: error: ‘IPT_ECN_OP_MATCH_CWR’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:81:3: warning: passing argument 2 of ‘match_tcp’ from incompatible pointer type [enabled by default]
    net/ipv4/netfilter/ipt_ecn.c:31:20: note: expected ‘const struct ipt_ecn_info *’ but argument is of type ‘const struct ipt_ecn_info *’
    net/ipv4/netfilter/ipt_ecn.c: In function ‘ecn_mt_check’:
    net/ipv4/netfilter/ipt_ecn.c:93:10: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:93:24: error: ‘IPT_ECN_OP_MATCH_MASK’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:96:10: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:99:10: error: dereferencing pointer to incomplete type
    net/ipv4/netfilter/ipt_ecn.c:99:25: error: ‘IPT_ECN_OP_MATCH_ECE’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c:99:46: error: ‘IPT_ECN_OP_MATCH_CWR’ undeclared (first use in this function)
    net/ipv4/netfilter/ipt_ecn.c: At top level:
    net/ipv4/netfilter/ipt_ecn.c:113:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct ipt_ecn_info’
    make[3]: *** [net/ipv4/netfilter/ipt_ecn.o] Error 1
    make[2]: *** [net/ipv4/netfilter] Error 2
    make[1]: *** [net/ipv4] Error 2
    make: *** [net] Error 2

    Has anyone faced this and how did you resolve this?
    I have tried CodeSourcery as well as the NDK toolchain.

    • By steve William

      #6

      Solved!
      Mac OS X (Mountain Lion) by default has a case-insensitive file system. I had to create a case-sensitive disk and extract the the bz2 package there to have all the files. Ubuntu 12.04 has a case-sensitive file system by default. So it works on that too.

  4. By Rachit Rawat

    #7

    Hello,
    I am developer from XDA. I compiled latest open source archives for
    Xperia Tipo/Miro/J respectively. Now, even if I use stock ramdisk with
    no changes to sources, device hangs hangs at Sony logo. Is it problem
    with source or am i doing something wrong. The sources compiled are :
    Xperia J :11.0.A.7.5
    Xperia Tipo :11.0.A.0.16
    Xperia Miro :11.0.A.2.10
    Toolchain : Linaro 4.6.2
    I have even tried compiling with defonfig pulled from device. No luck
    Thanks

  5. By 崔凱

    #8

    Help me!!! Thanks…

    root@singdxs:/loveless/7.0.A.3.223/kernel# ARCH=arm CROSS_COMPILE=/opt/CodeSourcery/bin/arm-none-linux-gnueabi- make blue_hayabusa_defconfig
    HOSTCC scripts/basic/fixdep
    HOSTCC scripts/kconfig/conf.o
    HOSTCC scripts/kconfig/zconf.tab.o
    HOSTLD scripts/kconfig/conf
    #
    # configuration written to .config
    #
    root@singdxs:/loveless/7.0.A.3.223/kernel# ARCH=arm CROSS_COMPILE=/opt/CodeSourcery/bin/arm-none-linux-gnueabi- make
    scripts/kconfig/conf –silentoldconfig Kconfig
    CHK include/linux/version.h
    CHK include/generated/utsrelease.h
    make[1]: `include/generated/mach-types.h’ is up to date.
    CC kernel/bounds.s
    GEN include/generated/bounds.h
    CC arch/arm/kernel/asm-offsets.s
    GEN include/generated/asm-offsets.h
    CALL scripts/checksyscalls.sh
    HOSTCC scripts/genksyms/genksyms.o
    HOSTCC scripts/genksyms/lex.o
    HOSTCC scripts/genksyms/parse.o
    HOSTLD scripts/genksyms/genksyms
    CC scripts/mod/empty.o
    HOSTCC scripts/mod/mk_elfconfig
    MKELF scripts/mod/elfconfig.h
    HOSTCC scripts/mod/file2alias.o
    HOSTCC scripts/mod/modpost.o
    HOSTCC scripts/mod/sumversion.o
    HOSTLD scripts/mod/modpost
    HOSTCC scripts/kallsyms
    HOSTCC scripts/conmakehash
    HOSTCC scripts/bin2c
    CC init/main.o
    CHK include/generated/compile.h
    CC init/version.o
    CC init/do_mounts.o
    CC init/do_mounts_rd.o
    CC init/do_mounts_initrd.o
    LD init/mounts.o
    CC init/initramfs.o
    CC init/calibrate.o
    LD init/built-in.o
    HOSTCC usr/gen_init_cpio
    GEN usr/initramfs_data.cpio
    AS usr/initramfs_data.o
    LD usr/built-in.o
    CC arch/arm/vfp/vfpmodule.o
    AS arch/arm/vfp/entry.o
    AS arch/arm/vfp/vfphw.o
    CC arch/arm/vfp/vfpsingle.o
    CC arch/arm/vfp/vfpdouble.o
    LD arch/arm/vfp/vfp.o
    LD arch/arm/vfp/built-in.o
    CC arch/arm/kernel/elf.o
    AS arch/arm/kernel/entry-armv.o
    AS arch/arm/kernel/entry-common.o
    CC arch/arm/kernel/irq.o
    CC arch/arm/kernel/process.o
    CC arch/arm/kernel/ptrace.o
    CC arch/arm/kernel/return_address.o
    arch/arm/kernel/return_address.c:62:2: warning: #warning “TODO: return_address should use unwind tables” [-Wcpp]
    CC arch/arm/kernel/setup.o
    CC arch/arm/kernel/signal.o
    CC arch/arm/kernel/sys_arm.o
    CC arch/arm/kernel/stacktrace.o
    CC arch/arm/kernel/time.o
    CC arch/arm/kernel/traps.o
    CC arch/arm/kernel/armksyms.o
    CC arch/arm/kernel/module.o
    AS arch/arm/kernel/sleep.o
    CC arch/arm/kernel/sched_clock.o
    CC arch/arm/kernel/smp.o
    CC arch/arm/kernel/smp_tlb.o
    CC arch/arm/kernel/smp_scu.o
    CC arch/arm/kernel/crash_notes.o
    CC arch/arm/kernel/kprobes.o
    CC arch/arm/kernel/kprobes-decode.o
    CC arch/arm/kernel/sys_oabi-compat.o
    CC arch/arm/kernel/unwind.o
    CC arch/arm/kernel/swp_emulate.o
    CC arch/arm/kernel/pmu.o
    CC arch/arm/kernel/perf_event.o
    CC arch/arm/kernel/io.o
    LD arch/arm/kernel/built-in.o
    AS arch/arm/kernel/head.o
    CC arch/arm/kernel/init_task.o
    LDS arch/arm/kernel/vmlinux.lds
    CC arch/arm/mm/dma-mapping.o
    CC arch/arm/mm/extable.o
    CC arch/arm/mm/fault.o
    CC arch/arm/mm/init.o
    CC arch/arm/mm/iomap.o
    CC arch/arm/mm/fault-armv.o
    CC arch/arm/mm/flush.o
    CC arch/arm/mm/idmap.o
    CC arch/arm/mm/ioremap.o
    CC arch/arm/mm/mmap.o
    CC arch/arm/mm/pgd.o
    CC arch/arm/mm/mmu.o
    CC arch/arm/mm/vmregion.o
    CC arch/arm/mm/proc-syms.o
    CC arch/arm/mm/alignment.o
    arch/arm/mm/alignment.c:295:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
    error, forbidden warning: alignment.c:295
    make[1]: *** [arch/arm/mm/alignment.o] Error 1
    make: *** [arch/arm/mm] Error 2

    • By Oskar Andero

      #9

      I was unable to recreate this problem. What is on line 295 of your alignment.c?

      As a work-around you can build without the -Werror flag.

      -Oskar

  6. By Christos Sofis

    #10

    Hi,

    I tried to compile latest kernel (4.0.2.A.0.84) using arm-linux-gnueabi-gcc
    The process stops because warnings and the -Werror flag set to compile the kernel.

    If I actually remove the flag, compilation ends up successfully, but I don’t know whether it
    will be OK to flash the new kernel to Neo V.

    Do you have any suggestions about those warnings? Should I bother with them or not?

    Thank you in advance

    • By Oskar Andero

      #11

      We usually build our kernels with the prebuilt toolchain from Android. As you can see in other comments, many stumble on build warnings when using other gcc/binutils versions.

      Some warnings are fixed in later kernels and some are just whining from the compiler/linker. It’s up to you to make the judgement on how to handle the warnings.

      However, if you have something more specific we could of course take a look at it.

  7. By linux mount

    #12

    ARCH=arm CROSS_COMPILE=/opt/arm-2010q1/bin/arm-none-eabi-(؟؟؟؟؟؟؟؟؟؟؟) make semc_zeus_defconfig

    arm-none-eabi-gcc
    arm-none-eabi-gcc-4.7.2
    arm-none-eabi-g++
    arm-none-eabi-gcc-ar
    arm-none-eabi-ar

  8. By linux mount

    #13

    Xperia tipo dual =>?????????????????
    Xperia tipo => ??????????????
    Xperia miro => ??????????????
    Xperia go => ??????????????
    Xperia PLAY => semc_zeus_defconfig
    Xperia arc => semc_anzu_defconfig
    Xperia neo => semc_hallon_defconfig
    Xperia acro => semc_azusa_defconfig
    Xperia acro IS11S => semc_akane_defconfig
    Xperia pro => semc_iyokan_defconfig
    Xperia mini pro => semc_mango_defconfig
    Xperia ray => semc_urushi_defconfig
    Xperia mini => semc_smultron_defconfig
    Xperia arc s => semc_ayame_defconfig
    Xperia neo v => semc_haida_defconfig
    Xperia active => semc_satsuma_defconfig
    Live with Walkman => semc_coconut_defconfig
    Xperia neo L => semc_phoenix_defconfig

    • By Oskar Andero

      #14

      Hi,

      Xperia tipo dual => proj_TAP_defconfig
      Xperia tipo => proj_TAP_defconfig
      Xperia miro => proj_MES_defconfig
      Xperia go => riogrande_lotus_defconfig

      -Oskar

  9. By mostafa gholami

    #15

    Hi.
    Same Problem For Me.
    I am Sure allignment.c in arch/arm/mm (Line.298) is Somthing mising.

  10. By Jean-Marc GRIMAUD

    #16

    Hello,

    I encounter an issue when trying to build the kernel. Does anyone could help me ?

    I work in an Ubuntu PC (10.04).
    I have downloaded the toolchain for Linux from https://sourcery.mentor.com/sgpp/lit…al/release2188
    Then the kernel source code 6.1.A.0.452 from http://developer.sonymobile.com/downloads/xperia-open-source-archives/open-source-archive-for-build-6-1-a-0-452-6-1-a-0-453-and-6-1-a-0-454/

    and I execute:
    cd kernel
    ARCH=arm CROSS_COMPILE=~/Toolchain/ARM_GNU_Linux/bin/arm-none-linux-gnueabi- make fuji_nozomi_defconfig
    ARCH=arm CROSS_COMPILE=~/Toolchain/ARM_GNU_Linux/bin/arm-none-linux-gnueabi- make

    Then I have the following error:

    CC arch/arm/mm/proc-syms.o
    CC arch/arm/mm/alignment.o
    arch/arm/mm/alignment.c: In function ‘do_alignment’:
    arch/arm/mm/alignment.c:298:15: warning: ‘offset.un’ may be used uninitialized in this function [-Wuninitialized]
    error, forbidden warning: alignment.c:298
    make[1]: *** [arch/arm/mm/alignment.o] Error 1
    make: *** [arch/arm/mm] Error 2

    Many thanks in advance for your help !

  11. Pingback #18

    [...] und auch ältere Smartphones mit Android von Sony Ericsson. Eine Anleitung zum Kompilieren des Linux-Kernels. Allerdings ist hier seitens Qualcomm noch ein proprietärer (geschlossener) Treiber (Firmware) im [...]

Show more comments

1-20 of 90 comments. Show all comments