Still unable to build custom kernel

315 views
Skip to first unread message

UniCav

unread,
Dec 11, 2018, 1:48:11 PM12/11/18
to Android-x86
I'm still unable to get a kernel / image built if I customize the kernel at all.
All I did to begin with was take the default .config in the kernel folder and switch the CPU from Generic to Intel Atom.
Made sure the BayTrail items were selected, Intel SoC items and Atheros 6K drivers and firmware.
First run failed while compiling the kernel during the staging drivers.
I edited the config again and disabled all the staging drivers. Next run failed in the middle of SCSI drivers.
I disabled them and started again but IIRC there are some SCSI drivers needed for some BayTrail tablets,
I'm not sure if it's actually some failure to build these drivers or if I have something else going on.

Mauro Rossi

unread,
Dec 11, 2018, 5:06:38 PM12/11/18
to Android-x86
Hi,
android-x86 repo are all tested with provided config files

A few comments in line.


On Tuesday, December 11, 2018 at 7:48:11 PM UTC+1, UniCav wrote:
I'm still unable to get a kernel / image built if I customize the kernel at all.
All I did to begin with was take the default .config in the kernel folder and switch the CPU from Generic to Intel Atom.


 
Made sure the BayTrail items were selected, Intel SoC items and Atheros 6K drivers and firmware.
First run failed while compiling the kernel during the staging drivers.
I edited the config again and disabled all the staging drivers. Next run failed in the middle of SCSI drivers.

You need to delete .config in the $(OUT)/obj/kernel/.config to actually trigger a kernel rebuild

UniCav

unread,
Dec 11, 2018, 5:22:39 PM12/11/18
to Android-x86
So would it be better to just build x86 rather than x86_64? I know the cpu is x64 capable but with the low RAM and such I wondered if it would just be better to run 32-bit on it.
That said, all the 32-bit OS installs I've tried have failed to even run.
I've been running "make clean" before I try another build which deletes the entire build directory, or just "rm -rf out/*"

I have been running this to create my custom config then copying the .config to my home directory
 /usr/bin/make -C kernel O=$OUT/obj/kernel ARCH=x86_64 menuconfig

Then running this to build the image
/usr/bin/make -j2 iso_img TARGET_PRODUCT=android_x86_64 TARGET_KERNEL_CONFIG=(my custom config)

But after posting today and giving it some thought, I realized that it was causing me to start with the default linux kernel config rather than the android-x86 default config,
so I located the android-x86_64_defconfig file and copied it to my home directory, then loaded it in menuconfig and edited that instead.
Currently running a build since going on about 3 hours now and it's up to 72% so I may have found my problem.
If this does succeed I will try to build a 32-bit image as well and see if it will run.

Mauro Rossi

unread,
Dec 11, 2018, 5:37:50 PM12/11/18
to Android-x86
Hi,


On Tuesday, December 11, 2018 at 11:22:39 PM UTC+1, UniCav wrote:
So would it be better to just build x86 rather than x86_64? I know the cpu is x64 capable but with the low RAM and such I wondered if it would just be better to run 32-bit on it.

Yes, because instead you would run into a lot of x86_64 Android ABI issues
 
That said, all the 32-bit OS installs I've tried have failed to even run.

What platform?
 
I've been running "make clean" before I try another build which deletes the entire build directory, or just "rm -rf out/*"

I have been running this to create my custom config then copying the .config to my home directory
 /usr/bin/make -C kernel O=$OUT/obj/kernel ARCH=x86_64 menuconfig

Then running this to build the image
/usr/bin/make -j2 iso_img TARGET_PRODUCT=android_x86_64 TARGET_KERNEL_CONFIG=(my custom config)

But after posting today and giving it some thought, I realized that it was causing me to start with the default linux kernel config rather than the android-x86 default config,
so I located the android-x86_64_defconfig file and copied it to my home directory, then loaded it in menuconfig and edited that instead.
Currently running a build since going on about 3 hours now and it's up to 72% so I may have found my problem.
If this does succeed I will try to build a 32-bit image as well and see if it will run.


I use this commands

. build/envsetup.sh
lunch android_x86-user && make -j[X] kernel TARGET_KERNEL_CONFIG=(my custom x86 config)

or

lunch android_x86_64-user && make -j[X] kernel TARGET_KERNEL_CONFIG=(my custom x86_64 config)



UniCav

unread,
Dec 11, 2018, 6:28:21 PM12/11/18
to Android-x86
The platform is Dell Venue 8 Pro 5830
Baytrail platform is just terrible to try and work with but the tablet is still in new condition because I've hardly used it.
First distro I ever got to boot up and install was Bliss but it had several issues
Android-x86 8.1.rc1 32-bit would not boot
Gallium, Peppermint, Phoenix, OpenSuse Leap and Tumbleweed all failed on the tablet.
Debian 9.5 ran on it but no wifi or sound and just wasn't comfortable enough to keep working with.
Ubuntu 16.04, 18.04 / Lubuntu and Ubuntu-Touch all failed on the tablet.

Android-x86_64.8.1 rC1 is the only one that's booted live and installed completely. Sound, Wifi, Rotation all work immediately.
The battery indicator and wifi  indicator were working properly on the last build.
If I ever get to the point I can compile the kernels properly. and fix the suspend/hibernation the tablet will be pretty much done.
I haven't looked at the bluetooth yet but I wasn't expecting that to work anyway. Just wanted to have it handy around the house.

UniCav

unread,
Dec 12, 2018, 10:27:13 AM12/12/18
to Android-x86
Well the x86_64-atom image built so the issue was not using the proper defconfig to start with. Installed and working.
Sound, Wifi, Battery, Rotation, Screen Brightness. Sleep/Wake seems to be working so far.
Will continue to test

UniCav

unread,
Dec 12, 2018, 10:39:00 AM12/12/18
to Android-x86
Well first problem I found. OTG doesn't work after booting. Had to reboot the tablet to use the OTG cable. Something with USB Hotplug?

youling 257

unread,
Dec 12, 2018, 11:26:16 AM12/12/18
to Android-x86
mkdir 1
cd 1
git init
git checkout FETCH_HEAD
make android-x86_64_defconfig -C . O=../64
cd ../64
time make targz-pkg -i -j8

you can test my linux-4.19.7-android-x86_64+-x86.tar.gz https://drive.google.com/open?id=1fFL53JoErrelySWATHoiu1JZXHCd-9uU

youling 257

unread,
Dec 12, 2018, 11:47:07 AM12/12/18
to Android-x86
mount -o remount,rw /
tar xzvf /sdcard/Download/linux-4.19.7-android-x86_64+-x86.tar.gz
if install Androidx86 on /dev/block/xxx
mkdir /data/1
busybox mount /dev/block/xxx /data/1
/data/1, has android-8.1 folder, 8.1 folder, has kernel、ramdisk.img、initrd.img、system.img, 
cp /boot/vmlinuz-4.19.7-android-x86_64+ /data/1/android-8.1/kernel
use vmlinuz-4.19.7-android-x86_64+ replace kernel.
/boot/config-4.19.7-android-x86_64+ is android-x86_64_defconfig.

在 2018年12月13日星期四 UTC+8上午12:26:16,youling 257写道:

UniCav

unread,
Dec 12, 2018, 2:13:15 PM12/12/18
to Android-x86
I'll need to build this on my Ubuntu system and copy over. The tablet wouldn't even open the .gz file and doesn't have the power to build it.
Will see what I can do with it and test it out.
Thanks!

youling 257

unread,
Dec 12, 2018, 6:51:59 PM12/12/18
to Android-x86
Android terminal, su, tar xzvf to extract it,lib/modules/4.19.7-android-x86_64+ will extract to /system/lib/modules,
but may be system no enough space, on Ubuntu, resize2fs system.img, mount system.img, copy lib/modules/4.19.7-android-x86_64+ to system/lib/modules.
vmlinuz-4.19.7-android-x86_64+ replace kernel.

UniCav

unread,
Dec 13, 2018, 10:34:56 AM12/13/18
to Android-x86
It's really difficult to do anything directly on the tablet so for simplicity's sake I will just build the iso_img again on the Ubuntu VM that seems to be building well now.
What's the proper way to point the build to a different prebuilt kernel?
Can I just extract the tar.gz into a directory and use TARGET_PREBUILT_KERNEL= to point to that directory?

youling 257

unread,
Dec 13, 2018, 10:54:34 AM12/13/18
to Android-x86
Use Linux kernel method build vmlinuz and modules, used them to boot any one prebuild ISO Androidx86 7.1、8.1、Phoenixos、Bliss x86、cm x86, 
I think you need a easy method to unpack/repack prebuild ISO.

在 2018年12月13日星期四 UTC+8下午11:34:56,UniCav写道:

UniCav

unread,
Dec 13, 2018, 11:23:25 AM12/13/18
to Android-x86
squashfs-tools and mkisofs to unpack/repack the iso,
I just have to track down the right command to rebuild the initrd for it.
I'm still trying to just build the default image with the new kernel to be sure it is proper. My custom build did install and work except for the suspend/resume but I don't entirely trust it.
Figured it would be best to start with a clean default of 8.1

youling 257

unread,
Dec 13, 2018, 11:36:44 AM12/13/18
to Android-x86
Androidx86 different with any Linux distribution, needn't rebuild initrd.img, example Ubuntu boot/initrd.img-4.18.0-11-generic, Androidx86 needn't it.

UniCav

unread,
Dec 13, 2018, 12:23:23 PM12/13/18
to Android-x86
But on the ISO doesn't the initrd.img and intstall.img have to be replaced?
I tried replacing the kernel file and copying over libs on my tablet yesterday and it failed to boot so I'm going to reinstall from a fresh ISO if I can get it built

youling 257

unread,
Dec 13, 2018, 12:30:15 PM12/13/18
to Android-x86
Yes.

在 2018年12月14日星期五 UTC+8上午1:23:23,UniCav写道:

UniCav

unread,
Dec 13, 2018, 1:18:06 PM12/13/18
to Android-x86
I got an image to build with the 4-19 Kernel but it's only giving the "LIVE" options, No install option?
Message has been deleted

youling 257

unread,
Dec 13, 2018, 2:23:46 PM12/13/18
to Android-x86
# Create main menu
add_entry "$live" quiet
add_entry "$debug_mode" DEBUG=2
if [ -s ($android)$kdir/install.img ]; then
	add_entry "Installation" INSTALL=1
fi

you not repack install.img into ISO.

BTW,uefi boot, only need mount ISO,copy files to u-disk, needn't any Windows/Linux tools write iso to u-disk, can say needn't repack iso.
so the u-disk root directory, has these files, prebuild initrd.img、prebuild ramdisk.img、prebuild install.img、repacked system.sfs、custom kernel file、prebuild efi folder、prebuild boot folder.

在 2018年12月14日星期五 UTC+8上午2:18:06,UniCav写道:

UniCav

unread,
Dec 13, 2018, 2:52:01 PM12/13/18
to Android-x86
OK I'll try adding the entry.
So if I have an working 8.1 USB stick and I just replace /kernel with the new vmlinuz-4.19.7-android-x86_64+ 
what else do I need to replace in the file structure for it to boot and use the new kernel?
Or what's the proper steps to build a new ISO with the newer kernel?
Message has been deleted

youling 257

unread,
Dec 13, 2018, 6:51:18 PM12/13/18
to Android-x86
replace repacked system.sfs.

sudo tar xzvf linux-4.19.7-android-x86_64+-x86.tar.gz
sudo unsquashfs system.sfs
sudo mkdir /1
sudo resize2fs system.img 3G
sudo mount system.img /1
sudo cp -f -a lib/modules/4.20.0-rc6-android-x86_64+ /1/lib/modules
sudo umount /1
sudo e2fsck -f system.img
sudo mksquashfs system.img system.sfs

在 2018年12月14日星期五 UTC+8上午3:52:01,UniCav写道:
So if I have an working 8.1 USB stick and I just replace /kernel with the new vmlinuz-4.19.7-android-x86_64+ 
what else do I need to replace in the file structure for it to boot and use the new kernel.

Muhammad Ikram

unread,
Dec 14, 2018, 8:28:12 PM12/14/18
to Android-x86
Hey, can i update phoenix os mesa with android x86 ones? How to do it?

UniCav

unread,
Dec 17, 2018, 11:33:46 AM12/17/18
to Android-x86
The problem I seem to keep running into is that once the USB stick is created it's flagged read only and can't be edited, and once the ISO is unpacked, system.sfs is edited and iso repacked, it's no longer showing as bootable.  So I'm still trying to sort it out.

youling 257

unread,
Dec 17, 2018, 12:52:36 PM12/17/18
to Android-x86
I tried rebuild iso at long ago.
genisoimage -vJURT -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -input-charset utf-8 -V "Android-x86 LiveCD" -o /data/media/0/1.iso /data/media/0/cm14.1

在 2018年12月18日星期二 UTC+8上午12:33:46,UniCav写道:
127.0.0.1_20180515035214.txt

UniCav

unread,
Dec 17, 2018, 1:44:29 PM12/17/18
to Android-x86
That's the same command I've used along with several others from other guides to edit and repack ISO's. No matter what I try the ISO always gives a warning with Etcher that the image isn't bootable because it doesn't have a partition. I also have used isohybrid on the ISO's and that will clear the error in Etcher but the image still doesn't boot. I've tried dozens of different methods and the result is always a write-protected USB stick and a non-bootable image.

UniCav

unread,
Dec 17, 2018, 1:54:33 PM12/17/18
to Android-x86
I am so sorry. The issue is not the image it's Etcher. I just tried flashing the image to USB on Windows using Rufus and it booted and installed with no issues and the USB is writeable as well. I have to dump Etcher and try either dd or something else and see if that works properly.

UniCav

unread,
Dec 17, 2018, 1:59:26 PM12/17/18
to Android-x86
Getting back to the original discussion - With the 4.19 kernel, install OK, boot OK. Settings > Wifi crashes and will not open.
I'll try once more to update the kernel and system.sfs and see if it was just a glitch, but I should probably just sync your 4.19 complete branch and build the whole ISO

On Tuesday, December 11, 2018 at 12:48:11 PM UTC-6, UniCav wrote:
I'm still unable to get a kernel / image built if I customize the kernel at all.
All I did to begin with was take the default .config in the kernel folder and switch the CPU from Generic to Intel Atom.
Made sure the BayTrail items were selected, Intel SoC items and Atheros 6K drivers and firmware.
First run failed while compiling the kernel during the staging drivers.
I edited the config again and disabled all the staging drivers. Next run failed in the middle of SCSI drivers.

youling 257

unread,
Dec 17, 2018, 2:07:11 PM12/17/18
to Android-x86
you need provide dmesg.txt and log.txt.

在 2018年12月18日星期二 UTC+8上午2:59:26,UniCav写道:

gawen...@googlemail.com

unread,
Dec 18, 2018, 5:49:01 AM12/18/18
to Android-x86
For BayTrail you might want to edit the BoardConfig.mk (in device/generic/x86/BoardConfig.mk or x86_64 depending on your target) and add this line:
TARGET_ARCH_VARIANT=silvermont

this will make sure that the silvermont.mk in build/core/combo/arch/x86 is used, the silvermont assembler instructions in bionic/libc/arch-x86/silvermont, the silvermont target in external/ffmpeg and wherever TARGET_ARCH_VARIANT is checked. So this leads to various optimizations.

UniCav

unread,
Dec 18, 2018, 12:00:10 PM12/18/18
to Android-x86
I started with a fresh repo sync yesterday to flush out all the changes I'd made and successfully built a default oreo-x86 iso. It flashed, booted and installed fine.
Had the original issue of the battery indicator showing charging all the time (as expected and proved I'd created a clean default iso).
I still don't know why the USB stick is always read only after the image is flashed to it on Linux and I haven't found any way yet to fix that.
It happens on my Ubuntu 18.04 system with Etcher, dd and isomaster.
If I flash it with Rufus on Windows the USB is not flagged read only and I can edit the contents.

Next I tried replacing ../out/product/x86/kernel with the vmlinuz-4.19.7-android-x86_64+ file
and adding the lib/modules/4.19.7-android-x86_64+ folder to  ../out/product/x86/system/lib/modules
Then built another ISO. This one also built, flashed, booted and installed, but it seems to have the exact same issues so it doesn't appear to have used the new kernel or modules.

I've gone back in and patched exfield.c to fix the battery indicator. Previously that's all I had to do to get the system working well enough to start tweaking before I tried figuring out how to change the kernel.
I've added the TARGET_ARCH_VARIANT line to BoardConfig.mk to see what that does. First run it complained that there was no silvermont-x86.mak file in ffmpeg. I copied the silvermont.mak file to that file name and it seems to be farther along. Will see if I get this built.

I know there's a build switch to use a different kernel that should allow me to point it at my 4.19 download or the git repo of 4.19 that I synced but I haven't been able to get the syntax right and get a build

UniCav

unread,
Dec 18, 2018, 4:37:44 PM12/18/18
to Android-x86
After renaming the 2 silvermont files to suit ffmpeg the image built successfully. Installed OK. Battery and wifi indicator are working.
So far it's surviving sleep/resume, but that usually takes awhile to kill it. Also waiting to see if I have the odd issue where the wifi stops responding.
USB Hotplug does not work as before. If I want to use USB I have to power down, plug up the USB drive or devices, and reboot. Then touch is dead until I shut down and unplug.
SD Card slot is working.
I still haven't sorted out how to actually build the 4.19 kernel and actually install it onto the tablet working.
Reply all
Reply to author
Forward
0 new messages