[Wanted] Kernel Open Source Code - Huawei Mate 9 Questions & Answers

Android has Modified Linux kernel under GNU GPL v2 which means manufacturer must share their kernels for devices when asked.
But... It is Huawei...
When other companies released their kernel sources, Huawei posted only text files.
Huawei Open Source MiniSite
MHA Open Source Text File
LON Open Source Text File
Text file:
Huawei Device Co., Ltd ("Huawei")is pleased to provide you the corresponding open source code of the device. If you want the code, please contact us with an email titled "Open Source Codes Issue" to [email_removed_against_spam_it_is_in_text_file_by_link]. Please note we may charge you the cost of physically performing source distribution like sending you a CD of the Open Source Codes, if you reqest. And the code download link will be ready soon.
I tried two times, sent emails, but nobody answered to me. It looks like Xiaomi did. They delayed posting code for 6 months and more. And there is nothing to do...

I am ready to sign a petition !
Sent from my MHA-AL00 using Tapatalk

Could you PM me the email?
Nvm, found it.

ante0 said:
Could you PM me the email?
Click to expand...
Click to collapse
It is in text file by link above
Anyway, i PM to you)

5[Strogino] said:
It is in text file by link above
Anyway, i PM to you)
Click to expand...
Click to collapse
Emailed them too now.
I guess, if they don't provide a source, we could ask GNU GPL for help

emailed to them, Hope I can get reply

I just sent them an email.

If you take time to actually read. They are "working on it"

LastStandingDroid said:
If you take time to actually read. They are "working on it"
Click to expand...
Click to collapse
So probably anytime from now to years in the future...

The Rollout of Nougat should be done end of First quarter, so i think it comes between april and may.

I have seen the new P10 and I loved it but came here to check how is Huawei behaving in terms of Kernel sources so devs can work on roms/mods. This post means that they wont give much facilities for this ?

Javi22 said:
I have seen the new P10 and I loved it but came here to check how is Huawei behaving in terms of Kernel sources so devs can work on roms/mods. This post means that they wont give much facilities for this ?
Click to expand...
Click to collapse
Chinese OEM's don't care for GPL.. If you are looking for a device with good development look elsewhere

liam_davenport said:
Chinese OEM's don't care for GPL.. If you are looking for a device with good development look elsewhere
Click to expand...
Click to collapse
Understand..sorry for little OT but although they dont release kernel, are there good mods possibilities using Xposed or this is like Xiaomi where xposed is very problematic with miui?
If not I would imagine that having a Huawei for 2 years or more is boring as you can't personalise too much

How do we help Huawei to release the 4.1.18 kernel source code ?
Code:
HWMHA:/data/data # uname -a
Linux localhost 4.1.18-g0ad0fb3 #1 SMP PREEMPT Tue Apr 11 12:25:26 CST 2017 aarch64
There is a kernel 3.10.90 source available for Honor-8 (FRD), which has similar device driver setup, but a different CPU (hi3650 vs. hi3660).
I could compile this kernel for FRD (with minor code editing), but the compilation for the hi3660 target failed because of some missing bit number
#define's and macros (for ppll2 and ppll3). If needed, these could be derived with relative ease by disassembling the respective functions in the current kernel:
Code:
HWMHA:/data/data # echo 1 > /proc/sys/kernel/kptr_restrict
HWMHA:/data/data # cat /proc/kallsyms | grep ppll
ffffffc000805e30 t xgene_pcppllclk_init
ffffffc000806668 t hi3xxx_multicore_ppll_disable
ffffffc0008067c0 t hi3xxx_multicore_ppll_enable
ffffffc0017a25b4 t hi3xxx_ppll_setup
ffffffc0017d4fb8 t __of_table_xgene_pcppll_clock
ffffffc0017d52d8 t __of_table_hi3xxx_ppll
ffffffc0018eaa70 d hi3xxx_ppll_ops
Another source of the hi3660 kernel code is hikey960 repository at https://github.com/96boards-hikey/linux , but it is missing many device
drivers necessary for the phone.
Both kernels also lack the Device Tree Spec (DTS) for Mate 9, although this one is readily available from the current kernel
Code:
HWMHA:/data/data # cat /sys/firmware/fdt > /storage/sdcard1/FDT
HWMHA:/data/data # exit
HWMHA:/ $ exit
# adb pull /storage/sdcard1/FDT
# dtc -o MHA.dts -O dts -I dtb FDT
Here is the beginning of the 500K MHA.dts file, providing all "MHA_TUGL_VN2" board configuration data:
Code:
/dts-v1/;
/ {
#address-cells = <0x2>;
#size-cells = <0x2>;
model = "hi3660";
compatible = "hisilicon,hi3660";
interrupt-parent = <0x1>;
hisi,boardid = <0x5 0x5 0x0 0x9>;
hisi,boardname = "MHA_TUGL_VN2";
hisi,modem_id = <0x3a001400>;
hisi,sub_platform_info3 = "Kirin960";
hisi,provider3 = "BALONG";
hisi,sub_platform_info2 = "Kirin960";
hisi,provider2 = "BALONG";
hisi,sub_platform_info1 = "Kirin960";
hisi,provider1 = "BALONG";
hisi,sub_platform_info0 = "Kirin960";
hisi,provider0 = "HUAWEI_K3";
hisi,platform_num = <0x4>;
hisi,gpu_arch = "mimir";
hisi,camera_arch = "platform_v110";
hisi,camera_arch_v120 = "platform_v120";
...

There is another good thing about the current 4.1.18 kernel: it includes the kexec syscall
Code:
HWMHA:/data/data # echo 1 > /proc/sys/kernel/kptr_restrict
HWMHA:/data/data # cat /proc/kallsyms | grep kexec
ffffffc0000c430c W compat_sys_kexec_load
ffffffc0000c430c W sys_kexec_file_load
ffffffc0000c430c W sys_kexec_load
ffffffc001766794 t setup_crash_kexec_post_notifiers
ffffffc0017d2092 t __setup_str_setup_crash_kexec_post_notifiers
ffffffc0017d6fa8 t __setup_setup_crash_kexec_post_notifiers
ffffffc001a75758 b crash_kexec_post_notifiers
so it should be possible to test a self-compiled kernel zImage without any flashing
https://wiki.archlinux.org/index.php/kexec
and using a bare ramdisk image (unspoiled by weird android stuff)
https://github.com/96boards-hikey/l-loader/blob/master/rootfs.tar.gz

Would it be possible to build a kernel module (like loop.ko) from the hikey960 repository?
Could such a kernel module be loaded into the kernel of the Mate 9?

st_voss said:
Would it be possible to build a kernel module (like loop.ko) from the hikey960 repository?
Click to expand...
Click to collapse
It is a pretty hardware-independent and generic module with stable ABI,
you can try a precompiled .ko from any aarch64 kernel for the same kernel version
(i don't know how strict do they check the version numbers).
Could such a kernel module be loaded into the kernel of the Mate 9?
Click to expand...
Click to collapse
We should check if there are any SELinux restrictions for loading modules, and how to work around them.
All the module infrastructure is compiled into the kernel
Code:
ffffffc000576198 T module_add_driver
ffffffc000576260 T module_remove_driver
...
Huawei currently does not use dynamic modules (probably to avoid the support nightmares)
Code:
HWMHA:/data/data # lsmod
Module Size Used by
HWMHA:/data/data # modprobe -av
modprobe: can't change directory to '/system/lib/modules': No such file or directory

I have compiled loop.ko in the hikey960 tree (modules are disabled there by default), but cannot insert it
Code:
HWMHA:/data/data # insmod /system/lib/modules/4.1.18-g0ad0fb3/loop.ko
insmod: failed to load /system/lib/modules/4.1.18-g0ad0fb3/loop.ko: Exec format error
HWMHA:/data/data # strace insmod /system/lib/modules/4.1.18-g0ad0fb3/loop.ko
...
getuid() = 0
geteuid() = 0
umask(0) = 0
umask(0) = 0
openat(AT_FDCWD, "/system/lib/modules/4.1.18-g0ad0fb3/loop.ko", O_RDONLY|O_CLOEXEC) = 3
finit_module(3, "", 0) = -1 ENOEXEC (Exec format error)
write(2, "insmod: ", 8insmod: ) = 8
write(2, "failed to load /system/lib/modul"..., 58failed to load /system/lib/modules/4.1.18-g0ad0fb3/loop.ko) = 58
write(2, ": Exec format error", 19: Exec format error) = 19
write(2, "\n", 1) = 1
...
HWMHA:/data/data # cat /proc/sys/kernel/modules_disabled
0
It was my error, because the loop driver is already in the kernel
Code:
HWMHA:/data/data # cat /proc/kallsyms | grep loop_ | grep trans
ffffffc0005804c0 T loop_register_transfer
ffffffc000580784 T loop_unregister_transfer
ffffffc00058362c t cryptoloop_transfer
ffffffc00170c620 R __ksymtab_loop_register_transfer
ffffffc00170c630 R __ksymtab_loop_unregister_transfer
ffffffc001739b20 r __kstrtab_loop_unregister_transfer
ffffffc001739b39 r __kstrtab_loop_register_transfer
PS. The problem is more complex, i can't also load other modules.
Code:
ffffffc000127b3c T sys_finit_module

...
It was my error, because the loop driver is already in the kernel
Code:
HWMHA:/data/data # cat /proc/kallsyms | grep loop_ | grep trans
ffffffc0005804c0 T loop_register_transfer
ffffffc000580784 T loop_unregister_transfer
ffffffc00058362c t cryptoloop_transfer
ffffffc00170c620 R __ksymtab_loop_register_transfer
ffffffc00170c630 R __ksymtab_loop_unregister_transfer
ffffffc001739b20 r __kstrtab_loop_unregister_transfer
ffffffc001739b39 r __kstrtab_loop_register_transfer
PS. The problem is more complex, i can't also load other modules.
Code:
ffffffc000127b3c T sys_finit_module
Click to expand...
Click to collapse
You are right. Loop support is already in the kernel.
And we can even use it if selinux is set permissive!
Code:
HWMHA:/data/data # losetup /dev/block/loop0
/dev/block/loop0: [1031e]:6429 (/data/magisk.img)
HWMHA:/data/data # mount -t ext4 -o loop /dev/block/loop0 /magisk
mount: '/dev/block/loop0'->'/magisk': Invalid argument
HWMHA:/data/data # setenforce 0
HWMHA:/data/data # mount -t ext4 -o loop /dev/block/loop0 /magisk
HWMHA:/data/data # mount | grep loop
/dev/block/loop0 on /magisk type ext4 (rw,seclabel,relatime,data=ordered)

st_voss said:
You are right. Loop support is already in the kernel.
And we can even use it if selinux is set permissive!
Code:
HWMHA:/data/data # losetup /dev/block/loop0
/dev/block/loop0: [1031e]:6429 (/data/magisk.img)
HWMHA:/data/data # mount -t ext4 -o loop /dev/block/loop0 /magisk
mount: '/dev/block/loop0'->'/magisk': Invalid argument
HWMHA:/data/data # setenforce 0
HWMHA:/data/data # mount -t ext4 -o loop /dev/block/loop0 /magisk
HWMHA:/data/data # mount | grep loop
/dev/block/loop0 on /magisk type ext4 (rw,seclabel,relatime,data=ordered)
Click to expand...
Click to collapse
What good exactly will it do us then? I'm lost in all that tech talk. Halp!

Related

[LINUX] Gentoo on your Desire (tutorial)

Gentoo on HTC Desire
Prerequisites:
Rooted Desire
Any flavour of Linux (Live or installed)
Code:
A decent sized MicroSD card (>2Gb recommended)
MicroSD USB adapter (or SD card reader and adapter)
Some knowledge of Linux command line and Gentoo is recommended
Patience...
Things you should know first:
This is NOT a fully independent Linux - it runs parallel to Android inside a chroot environment
Some applications can be very slow until they are compiled properly for the Desire hardware
Compilation with a 1GHz single core CPU is slow
You can run just about any Linux program; X programs and desktop environments can be used via VNC
Many custom ROMs and kernels do not include swap support for performance reasons, and so if you require swap you may need to compile your own kernel (I will upload my custom kernel at a later date)
Due to Android security settings, only root can use the network. This causes some problems as anything that requires network access must run as root (again, if anyone has any insight for a way around this, please contact me)
Some ROMs underclock the CPU when the screen is off - this will lead to VERY long compilation times if you leave your phone like that
Step one - Prepare MicroSD
To install Gentoo you will need an ext2, 3, or 4 filesystem on your MicroSD card. This can be done two ways: partitioning your card (recommended), or by creating a file and creating the filesystem within that (not covered here).
Start up GParted (or something similar) on your computer and insert your MicroSD card; if your card is fully allocated, you will need to shrink the existing partition(s) first (back up your data! This can go wrong...) and leave a space at the end of the card for your new partition. The absolute minimum I would recommend to dedicate to Gentoo would be 1GB, but that doesn’t give you much wiggle room and you will have a very hard time compiling anything big (like GCC); I would recommend making the partition >2GB. Make sure you create the Gentoo partition at the end of the card.
Note:
APP2SD+ requires its own partition - if you have it enabled, you must have at least three partitions, with the second partition on the card dedicated to it and the third for Gentoo.
Due to the large number of files in the Portage tree, small partitions can sometimes run out of inodes. You can get around this by decreasing the size of the inodes and blocks, and therefore creating more:
Code:
~ $ sudo mkfs.ext3 /dev/(partition) -i 2048 -b 2048
Step two - install base system:
Download the latest stage 3 tarball for armv7a-unknown-linux-gnueabi from the Gentoo mirror closest to you (Google "Gentoo Mirrors", I can't post links yet..), mount the Gentoo partition and extract the contents of the tarball to it.
Example:
Code:
~ $ wget (your selected mirror)/linux/gentoo/releases/arm/autobuilds/current-stage3/armv7a-unknown-linux-gnueabi/stage3-armv7a-20100917.tar.bz2
~ $ sudo mkdir /mnt/sd
~ $ sudo mount /dev/(partition) /mnt/sd
~ $ sudo tar xjvfp stage3-armv7a-20100917.tar.bz2 -C /mnt/sd/
Download the latest portage snapshot (from the Gentoo mirror) and extract:
Code:
~ $ wget (your selected mirror)/linux/gentoo/snapshots/portage-latest.tar.bz2
~ $ sudo tar xjvf portage-latest.tar.bz2 -C /mnt/sd/usr/
Now modify the make.conf file using your favourite text editor:
Code:
~ $ sudo nano /mnt/sd/etc/make.conf
Sample make.conf:
Code:
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -O2" # if anyone has any suggestions to improving these, please let me know
CXXFLAGS=${CFLAGS}
CHOST="armv7a-unknown-linux-gnueabi"
USE="unicode X -gnome -kde -firefox wifi syslog -udev -mdev -wifi -gpm threads nptl networking wxwidgets -ipv6 sqlite jpeg png dbus" # Have a look at the Gentoo USE flag description page on the web for others you may want/don't want
VIDEO_CARDS="none"
ALSA_CARDS="none"
INPUT_DEVICES="none"
SYNC="rsync://(your selected mirror)"
GENTOO_MIRRORS="(your selected mirror)"
ACCEPT_LICENSE="*"
MAKEOPTS="-j1"
PORTAGE_NICENESS="19"
AUTOCLEAN="yes"
FEATURES="noman nodoc noinfo -userfetch" # Getting rid of the man, doc and info pages saves a lot of space. Userfetch is disabled due to the issue described above
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog" # Again, this saves some space
Edit locale.gen with the locale values you require, e.g.:
Code:
en_US.UTF-8 UTF-8
Unmount your MicroSD card and insert it back into your phone.
Step three - configuring the base system
Using ConnectBot, another terminal emulator app, or adb, connect to the local console and setup the mounts, then enter Gentoo (using busybox as your shell (type "busybox sh") is recommended as the tab completion (trackball + i in connectbot) helps a lot):
Code:
# mkdir /data/gentoo
# mount -t ext3 (or whatever fs you set it to) /dev/block/mmcblk0p3 (change the 3 to whatever partition you need) /data/gentoo
# mount -t proc none /data/gentoo/proc
# mount -o bind /dev /data/gentoo/dev
# mount -t devpts none /dev/pts
# chroot /data/gentoo /bin/bash
# source /etc/profile
Congratulations! You are now inside your own Gentoo environment. If you don't need your phone for a while you can now recompile and update the system (this will take quite a long time and will use a lot of data). This doesn't have to be done now, or at all, but it is highly recommended to do so at some point:
Code:
# emerge -DuNav world
Once that's done (or you don't want to do it), install some base programs:
Code:
# emerge -av screen sudo
If you want VNC, tightvnc is recommended:
Code:
# emege -av tightvnc
Web server:
Code:
#emerge -av nginx
Set a root password:
Code:
# passwd
For some reason running SSHD with IPv6 enabled causes the phone to restart. To fix this, make the following changes to /etc/ssh/sshd_config:
Change:
Code:
#AddressFamily any
To:
Code:
AddressFamily inet
To start SSHD:
Code:
# ssh-keygen -t rsa (save to /etc/ssh/ssh_host_rsa_key with no passkey)
# ssh-keygen -t dsa (save to /etc/ssh/ssh_host_dsa_key with no passkey)
# /usr/sbin/sshd
If your kernel supports swap, it is recommended to create and enable it:
Code:
# dd if=/dev/zero of=/swap bs=10M count=20 (change this to alter the size of the swap file)
# mkswap /swap
# swapon /swap (you will need to run this command with the other mount commands each time you boot)
Boot script:
Start your phone in recovery mode and mount /system using the partitions menu in your recovery ROM, then create a file on your computer with the following contents:
Code:
#!/system/bin/sh
#
# Linux startup script for rooted Android systems
# © Deathisfatal @ forum.xda-developers.com
#
# TODO:
# - Error handling
#
# Edit the following variables as required
HOSTNAME="Android"
LINUX="/data/gentoo/"
BB="/system/xbin/busybox"
CHROOT="${BB} chroot ${LINUX}"
ROOT="/dev/block/mmcblk0p3"
SWAP="/swap"
${BB} mount -o noatime -t ext3 ${ROOT} ${LINUX} # Edit -t as required by your filesystem
${BB} mount -o bind /dev ${LINUX}dev
${CHROOT} /bin/mkdir /dev/shm
${CHROOT} /bin/mount -t tmpfs -o size=32m none /dev/shm
${CHROOT} /bin/mkdir /dev/fd
${BB} /bin/mount -o bind /proc/self/fd /dev/fd
${CHROOT} /bin/mount -t devpts none /dev/pts
${BB} mount -t proc none ${LINUX}proc
${CHROOT} /sbin/swapon ${SWAP}
${CHROOT} /bin/mount -t tmpfs -o size=32m none /tmp
${CHROOT} /bin/mkdir /tmp/run
${CHROOT} /bin/mkdir /tmp/run/portage
${CHROOT} /bin/touch /tmp/run/utmp
${CHROOT} /bin/chmod 777 -R /tmp
${BB} mount -o bind /data ${LINUX}mnt/data
${BB} mount -o bind /sdcard ${LINUX}mnt/sd
${CHROOT} /bin/hostname ${HOSTNAME}
# Uncomment the following line to enable sshd on boot
#${CHROOT} /usr/sbin/sshd
Connect your phone and computer with the USB cable, then use the following command on your computer:
Code:
~ $ adb push (File you created earlier) /system/etc/init.d/05linux
~ $ adb shell chmod 755 /system/etc/init.d/05linux
Now reboot your phone and your Gentoo partition should automatically mount.
Notes:
If you restart your phone, you will need to issue the necessary mount commands as you did earlier until I (or someone else) get around to making a proper script that runs at boot time
For information on how to set up programs and servers on Gentoo visit the Gentoo wiki
Please contact me or post here with any questions you may have regarding this
Changelog:
Updated CFLAGS and bootscript
Thanks to sfjuocekr for his/her contributions.
Thanks for this tutorial, Gentoo is my favourite Linux distro and it's great to know someone's got it running on the Desire
I don't think I've got the patience to try it on my phone though, all the compiling must take ages. I wonder whether it's possible to cross-compile...
F****ING AWESOME DUDE!
go to try in today =)
gentoo rulez!
koider said:
Thanks for this tutorial, Gentoo is my favourite Linux distro and it's great to know someone's got it running on the Desire
I don't think I've got the patience to try it on my phone though, all the compiling must take ages. I wonder whether it's possible to cross-compile...
Click to expand...
Click to collapse
DistCC
http://distcc.samba.org/
I have the same issue with openssh-server crashing my Nexus One (running Ubuntu 10.04 on CM6) too. I would love to figure out how to fix it.
Restored OP to state before server crashes - changed CFLAGS and added a boot script.
EDIT: I have solved the mystery of the SSHD crash!! It's to do with IPv6 - OP updated.
Deathisfatal said:
Restored OP to state before server crashes - changed CFLAGS and added a boot script.
EDIT: I have solved the mystery of the SSHD crash!! It's to do with IPv6 - OP updated.
Click to expand...
Click to collapse
Sweet. That solved my problem with sshd on chrooted Ubuntu on CM6 on my Nexus One! Thanks!
You should do a emerge -e world to recompile the whole tree after first boot.
This will make sure all your packages are compiled with correct CFLAGS etc.
Please delete me!
Solution found myself.
Code:
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="armv7a-unknown-linux-gnueabi"
USE="minimal unicode -X -gnome -kde -firefox -wifi syslog -udev -mdev threads nptl -ipv6 sqlite jpeg png dbus -gpm ssh"
VIDEO_CARDS="none"
ALSA_CARDS="none"
INPUT_DEVICES="none"
ACCEPT_LICENSE="*"
MAKEOPTS="-j1"
FEATURES="noman nodoc noinfo -userfetch"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog"
AUTOCLEAN="yes"
LINGUAS="en"
PORTAGE_NICENESS="19"
I use this make.conf for Gentoo on my Desire.
Firstly NEVER globally allow keywords, this is bad. Do this for the specific programs you need, you can use /etc/portage and mask/unmask packages you actually need unmasked.
Set MAKEOPTS to -j1 instead of 2, helps keeping the system usable while emerging together with PORTAGE_NICENESS at 19.
I have left X etc all out of the global USE flags to save space, again use /etc/portage to set specific USE flags for packages that need them. This will save alot of space, because there are lots of packages with X support you will never need usualy.
I'm not entirely sure about leaving wifi and mdev away, but wifi is handled by Android itself and mdev should be too.
Then in the startup-script there was a minor mistake bind mounting /dev/fd, this is the modified script:
Code:
#!/system/bin/sh
#
# Linux startup script for rooted Android systems
# © Deathisfatal @ forum.xda-developers.com
#
# TODO:
# - Error handling
#
# Edit the following variables as required
HOSTNAME="UGH-GSM"
LINUX="/data/gentoo/"
BB="/system/xbin/busybox"
CHROOT="${BB} chroot ${LINUX}"
ROOT="/dev/block/mmcblk0p2"
#SWAP="/swap"
${BB} mount -o noatime -t ext3 ${ROOT} ${LINUX}
${BB} mount -o bind /dev ${LINUX}dev
${CHROOT} /bin/mkdir /dev/shm
${CHROOT} /bin/mount -t tmpfs -o size=32m none /dev/shm
${CHROOT} /bin/mkdir /dev/fd
${BB} mount -o bind /proc/self/fd /dev/fd
${CHROOT} /bin/mount -t devpts none /dev/pts
${BB} mount -t proc none ${LINUX}proc
#${CHROOT} /sbin/swapon ${SWAP}
${CHROOT} /bin/mount -t tmpfs -o size=32m none /tmp
${CHROOT} /bin/mkdir /tmp/run
${CHROOT} /bin/mkdir /tmp/run/portage
${CHROOT} /bin/touch /tmp/run/utmp
${CHROOT} /bin/chmod 777 -R /tmp
${CHROOT} /bin/mkdir /mnt/data
${CHROOT} /bin/mkdir /mnt/sdcard
${BB} mount -o bind /data ${LINUX}mnt/data
${BB} mount -o bind /sdcard ${LINUX}mnt/sdcard
${CHROOT} /bin/hostname ${HOSTNAME}
# Uncomment the following line to enable sshd on boot
#${CHROOT} /usr/sbin/sshd
And yea some error handling should be added to check if a directory exists yes or no, but not really important.
If I make more changes, I'll make notice here in the forums. If you have other general Gentoo questions, please ask I have been working with Gentoo since 2001 But it is a really trial and error distribution, you HAVE to be self capable to fix problems that will arise ... they WILL arise
And again, leave
ACCEPT_KEYWORDS="~arm ~*" # Many useful packages are masked for arm with ~*
out of your makefile. Do it in /etc/portage when needed.
Don't use -O3 and -Os together, this actually GROWS ... same with using mcpu with march doesn't work just use march and mtune. -O2 is recommended.
http://www.gentoo.org/doc/en/gcc-optimization.xml
Also make sure you emerge linux-headers first so it ends up in world.
Usualy emerging a kernel makes sure headers are in place, but in this chrooted enviroment it isn't and might be cleaned with depclean or revdep-rebuild. Not sure why tho, because it should be in system already :s
This is a very interesting development! Thanks to everyone who made it possible.
Has anyone so far been able to run an Xserver / WM / DE yet?
Would love to see some screenshots of this in action..
sfjuocekr said:
Code:
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="armv7a-unknown-linux-gnueabi"
USE="minimal unicode -X -gnome -kde -firefox -wifi syslog -udev -mdev threads nptl -ipv6 sqlite jpeg png dbus -gpm ssh"
VIDEO_CARDS="none"
ALSA_CARDS="none"
INPUT_DEVICES="none"
ACCEPT_LICENSE="*"
MAKEOPTS="-j1"
FEATURES="noman nodoc noinfo -userfetch"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog"
AUTOCLEAN="yes"
LINGUAS="en"
PORTAGE_NICENESS="19"
I use this make.conf for Gentoo on my Desire.
Firstly NEVER globally allow keywords, this is bad. Do this for the specific programs you need, you can use /etc/portage and mask/unmask packages you actually need unmasked.
Set MAKEOPTS to -j1 instead of 2, helps keeping the system usable while emerging together with PORTAGE_NICENESS at 19.
I have left X etc all out of the global USE flags to save space, again use /etc/portage to set specific USE flags for packages that need them. This will save alot of space, because there are lots of packages with X support you will never need usualy.
I'm not entirely sure about leaving wifi and mdev away, but wifi is handled by Android itself and mdev should be too.
Then in the startup-script there was a minor mistake bind mounting /dev/fd, this is the modified script:
Code:
#!/system/bin/sh
#
# Linux startup script for rooted Android systems
# © Deathisfatal @ forum.xda-developers.com
#
# TODO:
# - Error handling
#
# Edit the following variables as required
HOSTNAME="UGH-GSM"
LINUX="/data/gentoo/"
BB="/system/xbin/busybox"
CHROOT="${BB} chroot ${LINUX}"
ROOT="/dev/block/mmcblk0p2"
#SWAP="/swap"
${BB} mount -o noatime -t ext3 ${ROOT} ${LINUX}
${BB} mount -o bind /dev ${LINUX}dev
${CHROOT} /bin/mkdir /dev/shm
${CHROOT} /bin/mount -t tmpfs -o size=32m none /dev/shm
${CHROOT} /bin/mkdir /dev/fd
${BB} mount -o bind /proc/self/fd /dev/fd
${CHROOT} /bin/mount -t devpts none /dev/pts
${BB} mount -t proc none ${LINUX}proc
#${CHROOT} /sbin/swapon ${SWAP}
${CHROOT} /bin/mount -t tmpfs -o size=32m none /tmp
${CHROOT} /bin/mkdir /tmp/run
${CHROOT} /bin/mkdir /tmp/run/portage
${CHROOT} /bin/touch /tmp/run/utmp
${CHROOT} /bin/chmod 777 -R /tmp
${CHROOT} /bin/mkdir /mnt/data
${CHROOT} /bin/mkdir /mnt/sdcard
${BB} mount -o bind /data ${LINUX}mnt/data
${BB} mount -o bind /sdcard ${LINUX}mnt/sdcard
${CHROOT} /bin/hostname ${HOSTNAME}
# Uncomment the following line to enable sshd on boot
#${CHROOT} /usr/sbin/sshd
And yea some error handling should be added to check if a directory exists yes or no, but not really important.
If I make more changes, I'll make notice here in the forums. If you have other general Gentoo questions, please ask I have been working with Gentoo since 2001 But it is a really trial and error distribution, you HAVE to be self capable to fix problems that will arise ... they WILL arise
And again, leave
ACCEPT_KEYWORDS="~arm ~*" # Many useful packages are masked for arm with ~*
out of your makefile. Do it in /etc/portage when needed.
Don't use -O3 and -Os together, this actually GROWS ... same with using mcpu with march doesn't work just use march and mtune. -O2 is recommended.
http://www.gentoo.org/doc/en/gcc-optimization.xml
Click to expand...
Click to collapse
Thanks very much for your insight! I'll change the tutorial with your suggestions when I'm at a computer later on.
I originally just had -Os for optimization but someone suggested using it with -O3, but their post got lost with the server crash. I've only been using Gentoo for a year now so I'll bow to your wisdom!
I have tightvnc setup along with openbox, so I'll post a couple of screenshots later on too.
EDIT: Is there any benefit to having -mfpu=neon? Or is vfpv3 superior?
Sent from my HTC Desire using XDA App
I'm currently working on getting Gentoo running natively with the S-OFF hack. At the moment I have it booting up, connecting to wifi and starting sshd, but X is a hassle. If anyone wants to collaborate on the project send me a message or post here; any help would be greatly appreciated!
Respect!
Deathisfatal said:
I'm currently working on getting Gentoo running natively with the S-OFF hack. At the moment I have it booting up, connecting to wifi and starting sshd, but X is a hassle. If anyone wants to collaborate on the project send me a message or post here; any help would be greatly appreciated!
Click to expand...
Click to collapse
Massive project! I'm impressed.
I wish I had any skill to be able to support you.
Deathisfatal said:
Thanks very much for your insight! I'll change the tutorial with your suggestions when I'm at a computer later on.
I originally just had -Os for optimization but someone suggested using it with -O3, but their post got lost with the server crash. I've only been using Gentoo for a year now so I'll bow to your wisdom!
I have tightvnc setup along with openbox, so I'll post a couple of screenshots later on too.
EDIT: Is there any benefit to having -mfpu=neon? Or is vfpv3 superior?
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Don't know for sure. I could try compile against neon to see if there is a speed increase. But to my knowledge neon instructions are already used or might only be use with vfpf3-d32.
Once I get my own box up and running again, I'll try it out. Compiling GCC without DISTCC is a horror!
Sorry about the lack of updates to the thread - I've been pretty busy at uni lately. I'm currently having a lot of issues with X11 segfaulting randomly so I'll post pictures once I have that back up and running. When X decides to work, the whole interface works nicely - touch support via tslib is great, and fbdev seems adequate for 2D graphics.
Has anyone had any success with the tutorial I posted?
If anyone's interested, to get Gentoo running natively you need to compile your own kernel with a few changes:
Disable ramdisk support
Enable swap (optional)
Create a boot script that mounts FS's, proc, etc
Disable Android paranoid networking so users other than root can access the net
Then start your phone in fastboot, push your modified kernel to your phone with fastboot with "root=/dev/mmcblk0p3 (or mmcblk0p2) init=(your boot script) rootfs=ext3 rootwait" as the kernel command line.
When I have time I will create a full guide for getting Linux and X running.
Massive project! I'm impressed.
I wish I had any skill to be able to support you.
Click to expand...
Click to collapse
Thanks!
sfjuocekr said:
Once I get my own box up and running again, I'll try it out. Compiling GCC without DISTCC is a horror!
Click to expand...
Click to collapse
Indeed! I left GCC 4.5 compiling for 6 hours, only for it to run out of space and fail...
ANd on v6 CPU?
Thanks for the tutorial, Deathisfatal. I thought this was a great idea, so decided to try it on my HTC Hero (as opposed to Desire).
On the first try, the
chroot /data/gentoo /bin/bash
command failed with an "illegal instruction" error. I figured my processor must be an earlier one in the ARM family than the one for which the bash in the stage 3 tarball had been compiled (v7-a). Sure enough, when I looked in /proc/cpuinfo, the processor turned out to be a v6 - the first line of cpuinfo says
ARMv6-compatible processor rev2 (v6l)
So, I tried again using stage3-armv6j-20101112.tar.bz2 instead of stage3-armv7a-20101114.tar.bz2. This improved things a bit. I could then run the bash shell in the chrooted environment, and cd and ls around the chrooted filesystem.
Unfortunately, attempting to run emerge still failed with an "illegal instruction" error (so did attempting to run tar or wget). At this point, I'm stuck. I guess I still have a stage 3 for the wrong processor variant (and that at some point I'll also have to fiddle with the -march and -mtune options in CFLAGS), but have no idea how to select the right stage 3.
Advice welcome, thanks.
That's quite strange! Perhaps try the armv5tel stage3 tarball. It could be that the armv6 stage3 is compiled for a different FPU than what the Hero has. What does the features line say in /proc/cpuinfo?
Deathisfatal said:
That's quite strange! Perhaps try the armv5tel stage3 tarball. It could be that the armv6 stage3 is compiled for a different FPU than what the Hero has. What does the features line say in /proc/cpuinfo?
Click to expand...
Click to collapse
Thanks. I'll give v5tel a go.
The features line says
swp half thumb fastmult edsp java

[Tutorial] How to compile a kernel module outside the kernel

I've decided to make a short tutorial and present the way I compile kernel modules (outside the kernel sources).
I've built few kernel modules (governors - ineractive and smartass, cifs, nls, etc) and I started receiving private messages asking how I did it.
For kernel modules that come with the kernel itself - cifs / tun for example - they just work if you compile the kernel and activate correct config parameters.
Some other modules (such as the smartass governor that doesn't come with the kernel) you compile outside the kernel source. However they require changes since kernel does not export the symbols the module needs to use - so you have to know what k_all_syms are needed, grab them from the phone and update the kernel module.
So there will be changes there. However, the main steps are:
a) follow tutorials to get the kernel / android ndk to compile. People seem able to do this.
b) then take the module you want (For example cpufreq_smartass.c from here: http://pastebin.com/rR4QUCrk ) and copy it in a new folder on the disk.
c) create a Makefile like the one below, but with your paths of course:
Code:
KERNEL_DIR=/home/viulian/android_platform/kernel-2.1.A.0.435/kernel
obj-m := cpufreq_smartass.o
PWD := $(shell pwd)
default:
$(MAKE) ARCH=arm CROSS_COMPILE=/home/viulian/android_platform/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
clean:
$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) clean
d) execute make
Of course, the module source needs to be adjusted as you need to put in the frequencies, and also update the k_all_syms pointers .. But you can retrieve them from /proc/kallsyms on the device itself - just look for the method name, and use the address you see in the log.
If you still can't get it to compile, try to compile a very basic hello_world kernel module. I used the code below when testing:
Code:
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("viulian, 2011");
MODULE_DESCRIPTION("Demo module for X10i");
int init_module(void)
{
printk("<1>Hello world\n");
// A non 0 return means init_module failed; module can't be loaded.
return 0;
}
void cleanup_module(void)
{
printk(KERN_ALERT "Goodbye world 1.\n");
}
It is not perfect, but if you manage to insmod-it and check dmesg, you will see "Hello world" written there.
One more thing, linux kernel is fussy about the module versions. Even if nothing is changed between two kernel versions related to what a module needs, is enough a small difference in module's modinfo value to make the kernel to refuse the module.
For this, you need to trick your local kernel and adjust EXTRAVERSION value in kernel's main Makefile to have the exact version of the one on the device:
In X10 stock kernel (GB 2.3.3 release), the kernel version is 2.6.29-00054-g5f01537 visible in phone settings.
This means that the kernel on the phone will only accept modules that are compiled for that exact version. But the kernel version is just a string in the module .ko, so is a string comparison - the module might work perfectly, but is not loaded.
There is luck though, the string value comes from a define in kernel's Makefile, which you can change before you compile!
The Makefile in the kernel you are going to use to build the module will have to include these lines at the top:
Code:
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 29
EXTRAVERSION = -00054-g5f01537
Other than that, it should work .. Expect phone reboots and difficulty to debug if stuff goes wrong. Android kernel doesn't come with syslog functionality, kernel prints are found in /proc/kmsg. Dmesg works, but you can't execute if if phone reboots.
I usually had to keep another adb shell opening with 'cat /proc/kmsg' which showed as much as possible from the module's outputs.
Happy compiling on your risk!
Good
Sent from my GT-S5570 using Tapatalk
Nice really nice.
Anyone help me.have someone who could compile the linux bluetooth modules please? Iam noob in linux
http://www.multiupload.com/58OPISAYNH
Anyone please can make a video tutorial?
That's really nice of you for sharing this.
Guide to Compiling Custom Kernel Modules in Android
I've spent the better part of today trying to figure out how to compile and load a custom kernel modules in android to aid me in my research. It has been in entirely frustrating experience, as there is almost no documentation on the topic that I can find. Below you will find my attempt at a guide. Hopefully this will help save someone else the hassle.
PREREQUISITES
Disclaimer: This list may be incomplete, since I've not tried it on a fresh install. Please let me know if I've missed anything.
Install the general android prereqs found here .
Download and un(zip|tar) the android NDK found here .
http://developer.android.com/sdk/ndk/index.html
Download and un(zip|tar) the android SDK found here .
http://developer.android.com/sdk/index.html
Download and untar the kernel source for your device. This can usually be found on the website of your device manufacturer or by a quick Google search.
Root your phone. In order to run custom kernel modules, you must have a rooted phone.
Plug your phone into your computer.
PREPARING YOUR KERNEL SOURCE
First we must retrieve and copy the kernel config from our device.
Code:
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
Next we have to prepare our kernel source for our module.
Code:
$ cd /path/to/kernel
$ make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- modules_prepare
PREPARING YOUR MODULE FOR COMPILATION
We need to create a Makefile to cross-compile our kernel module. The contents of your Makefile should be similar to the following:
Code:
obj-m := modulename.o
KDIR := /path/to/kernel
PWD := $(shell pwd)
CCPATH := /path/to/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
COMPILING AND INSTALLING YOUR MODULE
Code:
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/modulename.ko /sdcard/modulename.ko
RUNNING YOUR MODULE
Code:
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /sdcard/modulename.ko
---------- Post added at 07:40 PM ---------- Previous post was at 07:37 PM ----------
IMPORNTANT TOO
Preparing a build environment
To build an Android kernel, you need a cross-compiling toolchain. Theoretically, any will do, provided it targets ARM. I just used the one coming in the Android NDK:
$ wget http://dl.google.com/android/ndk/android-ndk-r6b-linux-x86.tar.bz2
$ tar -jxf android-ndk-r6b-linux-x86.tar.bz2
$ export ARCH=arm
$ export CROSS_COMPILE=$(pwd)/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
For the latter, you need to use a directory path containing prefixed versions (such as arm-eabi-gcc orarm-linux-androideabi-gcc), and include the prefix, but not “gcc”.
You will also need the adb tool coming from the Android SDK. You can install it this way:
$ wget http://dl.google.com/android/android-sdk_r12-linux_x86.tgz
$ tar -zxf android-sdk_r12-linux_x86.tgz
$ android-sdk-linux_x86/tools/android update sdk -u -t platform-tool
$ export PATH=$PATH:$(pwd)/android-sdk-linux_x86/platform-tools
not yet ((((
Come on, please make video tuto
that's interesting.
Thanks for sharing
Any takers to do a video status? Come on people it would be good for newbies like me and many that tme around. When teaching the community grows.
hi
i'm traing to compile module for acer a500.
but i have got an error: Nothing to be done for `default'.
my makefile:
Code:
obj-m += hello.o
KDIR := /home/hamster/android
PWD := $(shell pwd)
CCPATH := /home/hamster/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
acer kernel code is located in /home/hamster/android
could you help me?
thanks
Thanks man. The step "modules_prepare" is what did the trick for me!
Makefile including tabs
hamsterksu said:
hi
i'm traing to compile module for acer a500.
but i have got an error: Nothing to be done for `default'.
my makefile:
Code:
obj-m += hello.o
KDIR := /home/hamster/android
PWD := $(shell pwd)
CCPATH := /home/hamster/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
acer kernel code is located in /home/hamster/android
could you help me?
thanks
Click to expand...
Click to collapse
This is probably because you need to add a tab in front of your $(MAKE). Without the tab it will not recognize the command.
Help with compiling module
I am trying to compile a module for Galaxy S. I am getting this error.
# insmod hello_world.ko
insmod: init_module 'hello_world.ko' failed (Exec format error)
These are the module related options that I have enabled in the .config
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
Further this is the cat /proc/kmsg out put
<3>[53597.457275] hello_world: version magic '2.6.35.7-I900XXJVP-CL264642 preempt mod_unload ARMv7 ' should be '2.6.35.7-I9000XXJVP-CL264642 preempt mod_unload ARMv7 '
Why am I getting this error??
These are the steps I followed,
1. Downloaded the GT-I9000_OpenSource_GB.zip from samsung open source.
2. Change the EXTRAVERSION to EXTRAVERSION = .7-I900XXJVP-CL264642 (kernel version shown on phone is [email protected] #2)
I tried with EXTRAVERSION = [email protected] as well.
3. Added this line to the main make file -
core-y := usr/ TestModule/
5. Place the TestModule/ with the module code on the root directory.
6. Created the TestModule/Makefile and added this entry
obj-m := hello_world.o
4. On the read me of the kernel source it says to install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI, which I did.
5. Execute 'make aries_eur_defconfig'.
6. Execute make (again this is how the readme in the source says)
I have compiled this module for the emulator and it works fine, What am I doing wrong here?
Thanks in advance.
hamsterksu said:
hi
but i have got an error: Nothing to be done for `default'.
Code:
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Click to expand...
Click to collapse
be sure to have {tab} not space or other symbol before: $(MAKE) in:
Code:
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Hello,
I'm trying to load a module in my GS3 but I encounter problems about version. Maybe it's just a mismatch between the kernel i use to compile and the one on my phone.
I have a 3.0.31-742798 kernel version on my GS3, so I put this info in the makefile like viulian said but it didn't work.
I manage to compile and put the module on the phone, but when I want to insmod it, I've got
Code:
insmod: init_module 'hello_world.ko' failed (Exec format error)
and the /proc/kmsg say
Code:
... disagrees about version of symbol module_layout
And there no config.gz on the /proc/ dir like fabricioemmerick suggest to use
EDIT: I try to modify the symbol by copying the one of module from the phone. Have another error.
btw , with modinfo I found that the compilation always add -gc33f1bc-dirty after the subversion. Maybe something in the compilation goes wrong. Still use the stock kernel and the toolchain from the ndk sourcecode
m00gle said:
Hello,
I'm trying to load a module in my GS3 but I encounter problems about version. Maybe it's just a mismatch between the kernel i use to compile and the one on my phone.
I have a 3.0.31-742798 kernel version on my GS3, so I put this info in the makefile like viulian said but it didn't work.
I manage to compile and put the module on the phone, but when I want to insmod it, I've got
Code:
insmod: init_module 'hello_world.ko' failed (Exec format error)
and the /proc/kmsg say
Code:
... disagrees about version of symbol module_layout
And there no config.gz on the /proc/ dir like fabricioemmerick suggest to use
EDIT: I try to modify the symbol by copying the one of module from the phone. Have another error.
btw , with modinfo I found that the compilation always add -gc33f1bc-dirty after the subversion. Maybe something in the compilation goes wrong. Still use the stock kernel and the toolchain from the ndk sourcecode
Click to expand...
Click to collapse
Maybe your kernel source code version and your phone kernel version is different. If both are 3.0.31 but just the subversion is different, you can
try "insmod -f" to load. The -f option will ignore the version.
How can I get a dmesg of a specific kernel module using adb shell or any other way?
ravike14 said:
How can I get a dmesg of a specific kernel module using adb shell or any other way?
Click to expand...
Click to collapse
I'm not sure I understand the question ... you can just dmesg and grep by the module name ? Or some string that the module outputs ? You have full control
viulian said:
I'm not sure I understand the question ... you can just dmesg and grep by the module name ? Or some string that the module outputs ? You have full control
Click to expand...
Click to collapse
That's the part I don't understand, the grep part.. When I enter grep with my commamd I get as it's not a recognized command.. I'm using Windows is that the reason?
I'm using 'adb shell dmesg > dmesg.txt' how do I add the grep part for it and and the module name.. I did alot research but all are Linux kernel specific debugging guides.. What would be the exact command to grep a specific module.ko logs?
Sent from my HTC_Amaze_4G using XDA Premium 4 mobile app
ravike14 said:
I'm using 'adb shell dmesg > dmesg.txt' how do I add the grep part for it and and the module name.. I did alot research but all are Linux kernel specific debugging guides.. What would be the exact command to grep a specific module.ko logs?
Click to expand...
Click to collapse
I think I understand now
The order is this:
a) DroidSSHd from here: http://code.google.com/p/droidsshd/downloads/list
b) Busybox installer from the market.
c) Putty on your windows to connect to the phone
Now you can dmesg + grep once you are connected to the phone (don't forget to su before and allow DroidSSHd root).
You need to be connected to the phone since it is much more easier. Use the phone as your remote Linux machine.

Getting Working Wifi for Kernel builds

I have been buliding some kernels recently, but have been unable to get the wifi working.
I have tried it having the modules included in initramfs/lib/modules when ramdisk is created and i do mkbootimg, and have also tried just putting all the modules in the flash zip in /system/lib/modules, and excluded it from build process. Both result in no Wifi [Edit, putting the newly built correct modules in my working folders /lib/modules fixed wifi, must not have done it correctly before)
basic overview of what I've done (after zImage compile)
I use "./unpack-bootimg.pl boot.img" to pull the "ramdisk-contents" from the stock kernel, I renamed that folder "initramfs" and threw it in a folder along with my mkbootimg binary, and my zImage I just compiled.
I put the newly created modules from zImage build in my initramfs/libs/modules with
find -name '*.ko' -exec cp -av {} [path to desired folder] \;
I navigate to the initramfs folder and
find .|cpio -o -H newc > ../ramdisk
cd ..
gzip ramdisk
./mkbootimg --kernel ./zImage --ramdisk ./ramdisk.gz --board smdk4x12 --base 0x10000000 --pagesize 2048 --ramdiskaddr 0x11000000 -o boot.img
the resultant boot.img boots fine and shows all other changes, just cant seem to get the wifi working. Anyone have idea for getting wifi working on our Note 2 kernel builds?
Edit: I re-tried and this time it worked. Not sure what was different. Copied the newly created modules into my ramdisk folder (for me was /initramfs/lib/modules) and created my ramdisk.gz etc. made the boot.img and it's all good. The difference must've been having the correct modules in place prior to creating the ramdisk.cpio(then .cpio.gz).
Mods please move if you feel this is in wrong section now etc. Found the answer, thank you
It's only in the wrong section if you don't share what you did wrong, and how you fixed it.
Facing an almost similiar issue over here with the wifi modules. For me, I found that my boot.img is itself too large for initramfs to accomodate the compiled modules (optimization was off). So I put them in system/lib/modules and tried to insmod them.
Using the sbin's insmod gives me this:
Code:
[[email protected] android]$adb shell
[email protected]:/ $ su
[email protected]:/ # insmod /system/lib/modules/dhd.ko
insmod: init_module '/system/lib/modules/dhd.ko' failed (No such file or directory)
255|[email protected]:/ # busybox insmod /system/lib/modules/dhd.ko
insmod: can't insert '/system/lib/modules/dhd.ko': unknown symbol in module, or unknown parameter
2|[email protected]:/ #
I've turned off module versioning, and am not sure why there's a symbol error.
Droidzone said:
Facing an almost similiar issue over here with the wifi modules. For me, I found that my boot.img is itself too large for initramfs to accomodate the compiled modules (optimization was off). So I put them in system/lib/modules and tried to insmod them.
Using the sbin's insmod gives me this:
Code:
[[email protected] android]$adb shell
[email protected]:/ $ su
[email protected]:/ # insmod /system/lib/modules/dhd.ko
insmod: init_module '/system/lib/modules/dhd.ko' failed (No such file or directory)
255|[email protected]:/ # busybox insmod /system/lib/modules/dhd.ko
insmod: can't insert '/system/lib/modules/dhd.ko': unknown symbol in module, or unknown parameter
2|[email protected]:/ #
I've turned off module versioning, and am not sure why there's a symbol error.
Click to expand...
Click to collapse
Add --strip-debug into the LDFLAGS_MODULE of the main makefile and make sure the modules went through second stage compilation. The OS probably forwards some parameters and you can't just insmod it.
I fixed that issue..
The real reason is something queer and interesting. It was because I'd defined GREP_OPTIONS defined as '--color -in'. This seemed to interfere with the kernel scripts. Once the var was unset, problem was solved.
However the inability to load the module persists.
My main kernel has the version name "3.0.31-g5d44d80-dirty", and the vermagic of module seems to be "3.0.31-gc299ec6 SMP preempt mod_unload modversions ARMv7 p2v8".
This obviously leads to version mismatch, and inability to load the module. Do you know why this happens? The kernel and module were used from the same compilation session. In fact I havent even changed the version name in .config.
dmesg during insmod gives this error code which narrows down the issue:
Code:
c0 dhd: version magic '3.0.31-gc299ec6 SMP preempt mod_unload modversions ARMv7 p2v8 ' should be '3.0.31-g5d44d80-dirty SMP preempt mod_unload ARMv7 '
EDIT:
Maybe I had made a script error and forgot to replace the original kernel/module..That error has disappeared to be replaced by the former issue-unable to insert module. Module was compiled with debug symbols.
Insmod reports:
insmod: init_module '/system/lib/modules/dhd.ko' failed (No such file or directory)
Modprobe reports:
modprobe: chdir(3.0.31-ge52b835-dirty): No such file or directory
Kernel reports:
Code:
c0 dhd: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
Trying to narrow it down to the source file. I'm expecting that some function has 'forgotten' to export symbol.
I'm wondering whether this is just me, or is Samsung source dump supposed to have these kind of errors on defconfig. First they "forget" to include cypress drivers. Now errors related to symbol export.
EDIT2:
Still no more closer to finding the cause of the error. Did a grep and these are the only things I found:
Code:
[[email protected] kernel_IN]$grep --color -inr '_GLOBAL_OFFSET_TABLE_' * | grep -v 'Binary file'
arch/powerpc/boot/crt0.S:42: addis r11,r10,(_GLOBAL_OFFSET_TABLE_-p_base)@ha
arch/powerpc/boot/crt0.S:43: lwz r11,(_GLOBAL_OFFSET_TABLE_-p_base)@l(r11)
arch/m32r/boot/compressed/head.S:39: seth r3, #high(_GLOBAL_OFFSET_TABLE_+8)
arch/m32r/boot/compressed/head.S:40: or3 r3, r3, #low(_GLOBAL_OFFSET_TABLE_+12)
arch/s390/kernel/module.c:149: "_GLOBAL_OFFSET_TABLE_") == 0)
arch/avr32/kernel/module.c:104: "_GLOBAL_OFFSET_TABLE_") == 0)
scripts/mod/modpost.c:565: if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
System.map:49417:c0b4f468 d _GLOBAL_OFFSET_TABLE_
The relevant segment of scripts/mod/modpost.c:
Code:
static int ignore_undef_symbol(struct elf_info *info, const char *symname)
{
/* ignore __this_module, it will be resolved shortly */
if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
return 1;
/* ignore global offset table */
if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
return 1;
Edit3: Solved.
AndreiLux said:
Add --strip-debug into the LDFLAGS_MODULE of the main makefile and make sure the modules went through second stage compilation. The OS probably forwards some parameters and you can't just insmod it.
Click to expand...
Click to collapse
I'd like to thank you for this information - this cut my dhd.ko from 4.6 MB to around 550 kB - and my resulting kernel as a result. Fully expect this will now get my kernel working as it should.
Droidzone said:
I fixed that issue..
The real reason is something queer and interesting. It was because I'd defined GREP_OPTIONS defined as '--color -in'. This seemed to interfere with the kernel scripts. Once the var was unset, problem was solved.
However the inability to load the module persists.
My main kernel has the version name "3.0.31-g5d44d80-dirty", and the vermagic of module seems to be "3.0.31-gc299ec6 SMP preempt mod_unload modversions ARMv7 p2v8".
This obviously leads to version mismatch, and inability to load the module. Do you know why this happens? The kernel and module were used from the same compilation session. In fact I havent even changed the version name in .config.
dmesg during insmod gives this error code which narrows down the issue:
Code:
c0 dhd: version magic '3.0.31-gc299ec6 SMP preempt mod_unload modversions ARMv7 p2v8 ' should be '3.0.31-g5d44d80-dirty SMP preempt mod_unload ARMv7 '
EDIT:
Maybe I had made a script error and forgot to replace the original kernel/module..That error has disappeared to be replaced by the former issue-unable to insert module. Module was compiled with debug symbols.
Insmod reports:
insmod: init_module '/system/lib/modules/dhd.ko' failed (No such file or directory)
Modprobe reports:
modprobe: chdir(3.0.31-ge52b835-dirty): No such file or directory
Kernel reports:
Code:
c0 dhd: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
Trying to narrow it down to the source file. I'm expecting that some function has 'forgotten' to export symbol.
I'm wondering whether this is just me, or is Samsung source dump supposed to have these kind of errors on defconfig. First they "forget" to include cypress drivers. Now errors related to symbol export.
EDIT2:
Still no more closer to finding the cause of the error. Did a grep and these are the only things I found:
Code:
[[email protected] kernel_IN]$grep --color -inr '_GLOBAL_OFFSET_TABLE_' * | grep -v 'Binary file'
arch/powerpc/boot/crt0.S:42: addis r11,r10,(_GLOBAL_OFFSET_TABLE_-p_base)@ha
arch/powerpc/boot/crt0.S:43: lwz r11,(_GLOBAL_OFFSET_TABLE_-p_base)@l(r11)
arch/m32r/boot/compressed/head.S:39: seth r3, #high(_GLOBAL_OFFSET_TABLE_+8)
arch/m32r/boot/compressed/head.S:40: or3 r3, r3, #low(_GLOBAL_OFFSET_TABLE_+12)
arch/s390/kernel/module.c:149: "_GLOBAL_OFFSET_TABLE_") == 0)
arch/avr32/kernel/module.c:104: "_GLOBAL_OFFSET_TABLE_") == 0)
scripts/mod/modpost.c:565: if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
System.map:49417:c0b4f468 d _GLOBAL_OFFSET_TABLE_
The relevant segment of scripts/mod/modpost.c:
Code:
static int ignore_undef_symbol(struct elf_info *info, const char *symname)
{
/* ignore __this_module, it will be resolved shortly */
if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
return 1;
/* ignore global offset table */
if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
return 1;
Edit3: Solved.
Click to expand...
Click to collapse
How to Solved? Too detailed can you tell us a little bit?
wctliu said:
How to Solved? Too detailed can you tell us a little bit?
Click to expand...
Click to collapse
Used another toolchain.
Droidzone said:
Used another toolchain.
Click to expand...
Click to collapse
another toolchain????
Which version?
I uesd these:
/home/wctliu/toolchains/arm-eabi-4.4.3/bin/arm-eabi-
/home/wctliu/arm-2009q3/bin/arm-none-linux-gnueabi-
Which will cause the problem to occur?
wctliu said:
another toolchain????
Which version?
I uesd these:
/home/wctliu/toolchains/arm-eabi-4.4.3/bin/arm-eabi-
/home/wctliu/arm-2009q3/bin/arm-none-linux-gnueabi-
Which will cause the problem to occur?
Click to expand...
Click to collapse
Did you see and do the changes AndreiLux mentioned above to the makefile. That can be the difference of whether you get useable wifi modules. Simple place to start if your getting a working kernel but no wifi
Sent from my SPH-L900 using xda premium
sleshepic said:
Did you see and do the changes AndreiLux mentioned above to the makefile. That can be the difference of whether you get useable wifi modules. Simple place to start if your getting a working kernel but no wifi
Sent from my SPH-L900 using xda premium
Click to expand...
Click to collapse
YES i do it .
you can see this:
http://forum.xda-developers.com/showthread.php?t=2193358
and now, it's no wifi no exfat.
AndreiLux said:
Add --strip-debug into the LDFLAGS_MODULE of the main makefile and make sure the modules went through second stage compilation. The OS probably forwards some parameters and you can't just insmod it.
Click to expand...
Click to collapse
That is correct, the OS does pass parameters to the module when loading.
An example (from CM) can be seen at: https://github.com/CyanogenMod/andr...common/blob/cm-10.1/BoardCommonConfig.mk#L122
I cannot get Wifi to work either. I have the same exact problem as Droidzone with the "_GLOBAL_OFFSET_TABLE_" error.
I have checked that:
"LDFLAGS_MODULE = --strip-debug" is set in Makefile.
I'm using the 4.7 toolchain, but just tried the 4.6 to no avail.
Any help would be much appreciated.
Update: I was able to get it working by using CFLAGS_MODULE=-fno-pic as suggested in this guide.
Solved
I was running in the same issues. I solved my problem adding these to my kernel makefile:
LDFLAGS_MODULE = --strip-debug
CFLAGS_MODULE = -fno-pic
forfivo said:
I was running in the same issues. I solved my problem adding these to my kernel makefile:
LDFLAGS_MODULE = --strip-debug
CFLAGS_MODULE = -fno-pic
Click to expand...
Click to collapse
There must be something else goin on in my setup as this does not work for me to getting working WiFi. What is your build process?
Edit: or if you wouldn't mind shoot in me your kernel I'd be interested if it something small I'm missing like updater script etc
Edit2: I feel sometimes in android doing the same thing twice results in separate results. Crazy thx
Hey sorry to bump this. Not sure if anyone still remembers I have the same problem with my GT-B5330.
Even though I set in my kernel/Makefile :
CFLAGS_MODULE = -fno-pic
LDFLAGS_MODULE = --strip-debug
After building the kernel from source I get the dhd.ko file, copy it to ramdisk/lib/modules and then repack it with the zimage generated by the build.
Then i dd the newly created boot.img to the kernel partition.
lsmod doesnt show dhd.ko
and the file exists in system/lib/modules/dhd.ko
Toolchain arm-eabi-4.6
DroidFreak32 said:
Hey sorry to bump this. Not sure if anyone still remembers I have the same problem with my GT-B5330.
Even though I set in my kernel/Makefile :
CFLAGS_MODULE = -fno-pic
LDFLAGS_MODULE = --strip-debug
After building the kernel from source I get the dhd.ko file, copy it to ramdisk/lib/modules and then repack it with the zimage generated by the build.
Then i dd the newly created boot.img to the kernel partition.
lsmod doesnt show dhd.ko
and the file exists in system/lib/modules/dhd.ko
Toolchain arm-eabi-4.6
Click to expand...
Click to collapse
Are you able to test manually starting using insmod? If so, what is the result?
garwynn said:
Are you able to test manually starting using insmod? If so, what is the result?
Click to expand...
Click to collapse
I cannot insmod the module I get : /system/lib/module/dhd.ko invalid argument
DroidFreak32 said:
I cannot insmod the module I get : /system/lib/module/dhd.ko invalid argument
Click to expand...
Click to collapse
Can't get to my Linux env at the moment, but will follow up on this. Might even see if someone is willing to test for me.
garwynn said:
Can't get to my Linux env at the moment, but will follow up on this. Might even see if someone is willing to test for me.
Click to expand...
Click to collapse
Thanks man
Also I forgot to mention I use arm eabi 4.4.3 if that matters.

[Guide] Installing Debian on Android 4.2

Requirements:
An ARMv7 chipset (with VPFv3 if using armhf arch)
Loopback kernel support (if using img file as per this guide, otherwise could use dedicated partition on sdcard).
Rooted device
Busybox
Preparing an image:
On a linux machine setup filesystem for mounting on the android device, below I create a 2GB loopback image.
Code:
# dd if=/dev/zero of=wheezy-armhf.img bs=1M count=0 seek=2048
# mkfs.ext4 -F wheezy-armhf.img
# mount -o loop wheezy-armhf.img /debian
Now we populate the filesystem with the files to complete the debian installation.
Code:
# debootstrap --arch=armhf --variant=minbase --foreign wheezy /debian $DEBIANURL
# umount /debian
Complete installation:
Now on the android device we complete the debian installation.
Code:
# mount -o rw,remount rootfs /
# export LINUXROOT=/linux
# mkdir $LINUXROOT
# busybox mknod /dev/block/loop100 b 7 100
# losetup /dev/block/loop100 /path/to/wheezy-armhf.img
# mount -t ext4 /dev/block/loop100 $LINUXROOT
# busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
# mount -t proc none $LINUXROOT/proc
# mount -t sysfs none $LINUXROOT/sys
# mount -o bind /dev $LINUXROOT/dev
# mount -t devpts none $LINUXROOT/dev/pts
Now you can setup any other mounts you want, for example I bind mount my external USB storage etc. Now to login to the debian environment and install ssh server:
Code:
# export TMPDIR=/tmp
# export USER=root
# export HOME=/root
# export SHELL=/bin/bash
# export TERM=linux
# export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin
# export LC_ALL=C
# export LANGUAGE=C
# export LANG=C
# busybox chroot $LINUXROOT /bin/bash
We are now inside debian envrionment and perform some first time setup:
Code:
# passwd root
# groupadd -g 3001 aid_net_bt_admin
# groupadd -g 3002 aid_net_bt
# groupadd -g 3003 aid_inet
# groupadd -g 3004 aid_net_raw
# groupadd -g 3005 aid_net_admin
# groupadd -g 3006 aid_net_bw_stats
# groupadd -g 3007 aid_net_bw_acct
# groupadd -g 3008 aid_net_bt_stack
# echo "deb $DEBIANURL wheezy main" >/etc/apt/sources.list
# apt-get update
# apt-get install openssh-server
# exit
# sync
Now have a SSH service running that allows to login via ssh. Note that if you wish to use networking for other user accounts add them to the aid_inet and aid_net_raw groups. For example for transmission I did:
Code:
# apt-get install transmission-daemon
# usermod -a -G aid_inet,aid_net_raw debian-transmission
# invoke-rc.d transmission-daemon restart
chroot: can't change root directory to '/debootstrap/debootstrap': No such file or di
Hi!
First, thanks for your guide, the only one I've seen for Android 4.2
So I have a nexus 4 on Android 4.3 with Paranoid Android custom ROM and rooted with busybox 1.21 JB bionic (included with the ROM). I've done all the steps above until chroot, which gave me an error:
Code:
[email protected]:/ # busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
[COLOR="red"]E: No pkgdetails available; either install perl, or build pkgdetails.c from source[/COLOR]
1|[email protected]:/ #
So what now? how do I install Perl for android? Do I have to install microperl from busybox's site?
Please help me, I'm trying to install Debian for 4 days.
Pickout said:
Hi!
First, thanks for your guide, the only one I've seen for Android 4.2
So I have a nexus 4 on Android 4.3 with Paranoid Android custom ROM and rooted with busybox 1.21 JB bionic (included with the ROM). I've done all the steps above until chroot, which gave me an error:
Code:
[email protected]:/ # busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
[COLOR="red"]E: No pkgdetails available; either install perl, or build pkgdetails.c from source[/COLOR]
1|[email protected]:/ #
So what now? how do I install Perl for android? Do I have to install microperl from busybox's site?
Please help me, I'm trying to install Debian for 4 days.
Click to expand...
Click to collapse
I have that same problem. Any solution by now?
Thanks.
m
mickmattes said:
I have that same problem. Any solution by now?
Thanks.
m
Click to expand...
Click to collapse
I'll look into it, but it sounds like it has not bootstrapped the image correctly.
Pickout said:
Hi!
First, thanks for your guide, the only one I've seen for Android 4.2
So I have a nexus 4 on Android 4.3 with Paranoid Android custom ROM and rooted with busybox 1.21 JB bionic (included with the ROM). I've done all the steps above until chroot, which gave me an error:
Code:
[email protected]:/ # busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
[COLOR="red"]E: No pkgdetails available; either install perl, or build pkgdetails.c from source[/COLOR]
1|[email protected]:/ #
So what now? how do I install Perl for android? Do I have to install microperl from busybox's site?
Please help me, I'm trying to install Debian for 4 days.
Click to expand...
Click to collapse
No you don't need to install Perl. Something as gone wrong with one of the steps. I'll see what I can figure out. Are you using the armhf arch? Cause I could send you a premade image to see if that has any success for you.
Thanks for your help, I've finally found what's the problem (two weeks ago, I've forgotten this thread), but thanks!
(The problem was that the environment variables were not set up properly)
Thanks to these links, I've managed to install Debian 7 on a rooted Android phone. All credit goes to them:
http://linux-expert.net/?Trucs_et_astuces___Android___Tutoriel_%3A_Chroot_Debian (in french)
http://forum.xda-developers.com/showthread.php?p=45457799
http://forum.xda-developers.com/showthread.php?t=2312013
http://forum.xda-developers.com/showthread.php?t=631389
http://forum.xda-developers.com/showthread.php?t=1418546
http://forum.xda-developers.com/showpost.php?p=5671794&postcount=124
VNC
________________
I. On the PC
So first, you have to create the .img file that will contain the OS.
In a GNU/Linux environment (PC) and with the root permissions, type these commands:
Code:
# mkdir debian
# dd if=/dev/zero of=wheezy-armhf.img bs=1M count=0 seek=2048
[COLOR="Red"](NOTE: "of=" will be the name of our .img file and "seek=" the size of the file (MB). Here, we create a file named "wheezy-armhf.img" of 2 GB)[/COLOR]
# mkfs.ext4 -F wheezy-armhf.img
# mount -o loop wheezy-armhf.img /debian
Then we have to fill up the filesystem.
Code:
# debootstrap --foreign --arch=armhf wheezy debian/
# umount debian
Finally, move it to your SD Card. In my case, I moved it on /data/local/
II. On the phone
On your phone, in a terminal emulator and with the root permissions, type the following commands:
Code:
# mount -o rw,remount rootfs /
# export LINUXROOT=/linux
(NOTE: here we'll install Debian on the root of the internal memory, in "/", but we can also install Debian on the SD Card or in /data/loca/linux by changing the path after "LINUXROOT=")
# mkdir $LINUXROOT
# busybox mknod /dev/block/loop100 b 7 100
# losetup /dev/block/loop100 /sdcard/wheezy-armhf.img
# mount -t ext4 /dev/block/loop100 $LINUXROOT
# chroot $LINUXROOT /bin/sh
# export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# /debootstrap/debootstrap --second-stage
The debootstrap's second part should start. Grab a cup of coffee while it's working!
When it's finish, leave the chroot by typing
Code:
# exit
# su
Let's mount the filesystem. We're close!
Code:
# mount -t proc none /proc
# mount -t sysfs none /sys
# mount -o bind /dev /dev
# mount -t devpts none /dev/pts
Now, we have to set the environment variable. Ensure that you have set the correct path of LINUXROOT in case you've chosen another path than /linux.
Code:
# export LINUXROOT=/linux
# export TMPDIR=/tmp
# export USER=root
# export HOME=/root
# export SHELL=/bin/bash
# export TERM=linux
# export LC_ALL=C
# export LANGUAGE=C
# export LANG=C
And finally, chroot.
Code:
# chroot $LINUXROOT /bin/bash
su
Welcome on Debian!
III. DNS and Mirrors
Set a DNS. We'll set the free Google DNS but you can set yours if you want.
Code:
echo -e "domain local\nsearch local\n" >> /etc/resolv.conf
echo -e "# DNS Google\nnameserver 8.8.8.8\nnameserver 8.8.4.4\n" >> /etc/resolv.conf
You can add mirrors to your sources.list if you want. For my case, I'm french so I added french mirrors:
Code:
# echo -e "## Debian Wheezy sources.list\n\n" > /etc/apt/sources.list
# echo -e "## Debian.org FR mirror\ndeb http://ftp.fr.debian.org/debian/ wheezy main contrib non-free\ndeb-src http://ftp.fr.debian.org/debian/ wheezy main contrib non-free\n\n" >> /etc/apt/sources.list
# echo -e "## Debian security updates\ndeb http://security.debian.org/ wheezy/updates main contrib non-free\ndeb-src http://security.debian.org/ wheezy/updates main contrib non-free\n >> /etc/apt/sources.list
IV. VNC
To access your Debian in a graphical environment from your PC or your phone, you have to set up a VNC Server and install a Desktop Environment. Let's install VNC and LXDE.
We'll follow the steps described on the LXDE wiki:
Code:
su
# apt-get update
# apt-get install lxde
# apt-get install tightvncserver
Set up the VNC server by typing the following command, which will ask you to set two passwords (let the second password if you want):
Code:
# vncserver
Kill the session:
Code:
# vncserver -kill :1
Go to /root/.vnc/ and edit the xstartup file: comment out #/etc/X11/xsession and add these two lines:
icewm
lxsession
Click to expand...
Click to collapse
To start a VNC session, type "vncserver -geometry <HEIGHT>x<WIDTH>". For the Nexus 4, we would type "vncserver -geometry 1184x768"
To access your Desktop Environment from your phone, download android-vnc-viewer and launch it.
In the password field, type your password. In the address field, type "127.0.0.1", in port type "5901" and select 24-bit color (4bpp).
V. Script
I've made three scripts to mount, launch and unmount Debian. Whenever you reboot your phone, you'll have to mount Debian, set the environment variables and chroot.
VI. Credit
All credit goes to them:
http://linux-expert.net/?Trucs_et_astuces___Android___Tutoriel_%3A_Chroot_Debian (in french)
http://forum.xda-developers.com/showthread.php?t=2312013
http://forum.xda-developers.com/showthread.php?t=631389
http://forum.xda-developers.com/showthread.php?t=1418546
http://forum.xda-developers.com/showpost.php?p=5671794&postcount=124
VNC
Sorry for my bad english
Thanks for your work and solution. However I did not try it yet, because I'm trying to do it with the following solution. Perhaps I'll do this one next weekend
http://whiteboard.ping.se/Android/Debian
I really like the idea of it.
Just have a look.
P.S: By the way, I'm running Pacman-Rom (4.3) and it seems to work, if you flash googy-Kernel or some other Kernel. CM-Kernel has
some kind of SElinux restriction, which prevents you from changing the debian root password.
Wow, it sounds amazing! I will sure give it a try next week too.
Thanks for the link!
Pickout said:
Wow, it sounds amazing! I will sure give it a try next week too.
Thanks for the link!
Click to expand...
Click to collapse
I got stuck in a bootloop after flashing. I'm quite sure, that I did everything correctly...
I think my Pacman-Rom (JB 4.3) is to blame.
Thanks for the guide, was looking for something like this. I tried it first on an SD card formatted to ext4 (wanted a larger than 4GB .img file) but it failed to work. Went back to fat32 and for now kept a 4GB .img and after following you guide, it worked perfectly.
Where can I find the img ?
Hello,
Thanks for this how too!!
But where can I find the img ? wheezy-armhf.img ?
Thanks for your help,
Cheers,
Mat
matthieuDroid said:
Hello,
Thanks for this how too!!
But where can I find the img ? wheezy-armhf.img ?
Thanks for your help,
Cheers,
Mat
Click to expand...
Click to collapse
you make it yourself: the dd-command in the beginning creates a file called wheezy-armhf.img and fills it with zeros.
need enlightenment
hello,
i'm follow the instruction but get stuck with
# chroot $LINUXROOT /bin/sh
chroot: can't execute 'bin/sh': No such file or directory
Click to expand...
Click to collapse
pls help
i'm using galaxy note 3 n900 with armv7

Building LineageOS 16.0

Hi,
I'd ask this in the development forum but unfortunately that has a 10 post minimum, and i currently have 1 post.
I'm trying to compile lineage-16.0 for zerofltexx.
I tried using the local_manifests file from various github repositories (for instance enesuzun2002's and TeamNexus's) but am running into errors with android_hardware_samsung_slsi-cm_exynos7420.
I was wondering if someone could shine some light on how i would go about compiling this.
The errors i am running into are:
hardware/samsung_slsi-cm/exynos7420/mobicore/daemon/Common/CWsm.h:56:33: error: implicit conversion of NULL constant to 'uint64_t' (aka 'unsigned long') [-Werror,-Wnull-conversion]
hardware/samsung_slsi-cm/exynos7420/mobicore/daemon/Daemon/MobiCoreDriverDaemon.cpp:217:56: error: unused parameter 'connection' [-Werror,-Wunused-parameter]
To name a few (more information can easily be provided).
Since this repository hasnt been updated in quite some time and there are multiple unofficial roms for the zerofltexx i imagine i am doing something utterly wrong.
Does anyone have any experience with this?
Thanks a lot
Edit:
Building on Ubuntu 18.04
:good:
Use slsi repos of @ripee
ripee-zero
I pushed my local manifests as well
All devving courtesy of enesuzun2002.
ripee said:
github.com/ripee-zero
I pushes my local manifests as well
All devving courtesy of enesuzun2002.
Click to expand...
Click to collapse
Thanks a lot!
I'll try it out
ripee said:
github.com/ripee-zero
I pushes my local manifests as well
All devving courtesy of enesuzun2002.
Click to expand...
Click to collapse
Thanks so much for the help so far, i really appreciate it.
I've tried compiling with your local_manifests and it gets past the errors that i posted before.
It gets all the way to around 96% but unfortunately still gets a build error.
Is this something i've misconfigured?
The current build error is:
Code:
[ 2% 100/3408] Hidden API: /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar
FAILED: /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar
/bin/bash -c "(rm -f /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar ) && (cp \"/home/subcode/android/lineage/out/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar\" \"/home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar\" ) && (rm -rf /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (mkdir -p /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (unzip -q /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar 'classes*.dex' -d /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (find /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -name \"classes*.dex\" | sort | sed 's/^/--dex=/' | xargs /home/subcode/android/lineage/out/host/linux-x86/bin/hiddenapi --light-greylist=/home/subcode/android/lineage/out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt --dark-greylist=/home/subcode/android/lineage/out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt --blacklist=/home/subcode/android/lineage/out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt ) && (/home/subcode/android/lineage/out/soong/host/linux-x86/bin/soong_zip -o /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -C /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -D /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (/home/subcode/android/lineage/out/soong/host/linux-x86/bin/merge_zips -D -zipToNotStrip /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -stripFile \"classes*.dex\" /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar /home/subcode/android/lineage/out/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar )"
xargs: /home/subcode/android/lineage/out/host/linux-x86/bin/hiddenapi: terminated by signal 4
[ 3% 105/3408] Building Kernel Config
make: Entering directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
GEN /home/subcode/android/lineage/out/target/product/zerofltexx/obj/KERNEL_OBJ/Makefile
Kconfig:15:warning: environment variable ANDROID_MAJOR_VERSION undefined
arch/arm64/configs/lineageos_zerofltexx_defconfig:475:warning: override: reassigning to symbol IKCONFIG
#
# configuration written to .config
#
make: Leaving directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
make: Entering directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
GEN /home/subcode/android/lineage/out/target/product/zerofltexx/obj/KERNEL_OBJ/Makefile
scripts/kconfig/conf --savedefconfig=defconfig Kconfig
Kconfig:15:warning: environment variable ANDROID_MAJOR_VERSION undefined
make: Leaving directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
ninja: build stopped: subcommand failed.
12:28:24 ninja failed with: exit status 1
Edit: I've just found something that says its possibly a CPU problem.
Since i'm building inside a VM, i'll try building without a VM to see if this fixes the problem.
Edit2: Unfortunately compiling outside of my VM did not work.
Kyrraz said:
Edit: I've just found something that says its possibly a CPU problem.
Since i'm building inside a VM, i'll try building without a VM to see if this fixes the problem.
Click to expand...
Click to collapse
Reduce the amount of RAM and number of cores assigned to your vm.
ripee said:
Reduce the amount of RAM and number of cores assigned to your vm.
Click to expand...
Click to collapse
Any specific number i should be looking for?
edit: 1 core and 8GB of ram did not change anything, but since the other solution i found said its that i'm missing SSE4.1 support in my cpu im not sure less of anything would be better?
I'll try building on a different CPU, but this will be tomorrow at the earliest unfortunately.
Here's a late update,
Building with a more modern CPU did the trick, apparently you really do need SSE4.1 support.
Thanks a lot!
I have the same error but my CPU have SSE 4.1 support

Categories

Resources