Trying port Android x86 to Surface Book

727 views
Skip to first unread message

KenOokamiHoro

unread,
Jun 20, 2017, 4:26:55 AM6/20/17
to Android-x86
Hello, everyone. I'm trying to make Android-x86 work on my Surface Book.

  • I opened NVM Express Block Device Support in kernel config ( BLK_DEV_NVME =y )
    • Though installation program will back to select partition when selected a NVMe partition (/dev/nvme0n1p*)
    • In initrd.img :
    • for device in ${ROOT:-/dev/[hmsv][dmr][0-9a-z]*}; do
          check_root $device
      && break 2
          mountpoint
      -q /mnt && umount /mnt
      done
      So it will not find root in NVMe disks like /dev/nvme0 ......
      ( I used a dirty way (duplicate this code and change  ${ROOT:-/dev/[hmsv][dmr][0-9a-z]*} to  ${ROOT:-/dev/nvme0n[0-9]p[0-9a-z]*} ) to make it works now......
  • Surface Book' s touchscreen need external firmware to work ( https://github.com/ipts-linux-org/ipts-linux-new ) , so I tried to patch to Android x86's kernel:
    • I compared ipts's source and linux 4.9rc3 ( ipts's work is based in this version ) and make a patch file ( "touchpath.patch" in attachment ) and patched it to kernel.
    • I opened Intel Precise Touch & Stylus in kernel config ( CONFIG_INTEL_IPTS=m ) , because I tried to use CONFIG_INTEL_IPTS=y to compile and got a error.
    •   LD      init/built-in.o
      drivers/built-in.o: In function `ipts_open_gpu':
      (.text+0x1343c2): undefined reference to `intel_ipts_connect'
      drivers/built-in.o: In function `ipts_close_gpu':
      (.text+0x134435): undefined reference to `intel_ipts_disconnect'

      I successed when use CONFIG_INTEL_IPTS=m :
    • Kernel: arch/x86/boot/bzImage is ready  (#4)
        MODPOST 2349 modules
        LD [M]  drivers/gpu/drm/i915/i915.ko
        CC      drivers/misc/ipts/intel-ipts.mod.o
        LD [M]  drivers/misc/ipts/intel-ipts.ko
  • So I encountered a question about how to load it .
  • And is there a way to edit initrd and /system partition and build it ? ( I've view our website but I found how to custom kernel only.)
PS : English is not my native language; please excuse typing or grammer errors , and notify me If I'am walking on a wrong way.

Thanks everyone :-)

 
touchpatch.patch

Chih-Wei Huang

unread,
Jun 20, 2017, 4:42:15 AM6/20/17
to Android-x86
Nice work!

2017-06-20 15:16 GMT+08:00 KenOokamiHoro <kenook...@gmail.com>:
> Hello, everyone. I'm trying to make Android-x86 work on my Surface Book.
>
> I opened NVM Express Block Device Support in kernel config ( BLK_DEV_NVME =y
> )
>
> Though installation program will back to select partition when selected a
> NVMe partition (/dev/nvme0n1p*)
> In initrd.img :
> for device in ${ROOT:-/dev/[hmsv][dmr][0-9a-z]*}; do
> check_root $device && break 2
> mountpoint -q /mnt && umount /mnt
> done
> So it will not find root in NVMe disks like /dev/nvme0 ......
>
> ( I used a dirty way (duplicate this code and change
> ${ROOT:-/dev/[hmsv][dmr][0-9a-z]*} to ${ROOT:-/dev/nvme0n[0-9]p[0-9a-z]*} )
> to make it works now......

I'll address that in the next release.

> Surface Book' s touchscreen need external firmware to work (
> https://github.com/ipts-linux-org/ipts-linux-new ) , so I tried to patch to
> Android x86's kernel:
>
> I compared ipts's source and linux 4.9rc3 ( ipts's work is based in this
> version ) and make a patch file ( "touchpath.patch" in attachment ) and
> patched it to kernel.
> I opened Intel Precise Touch & Stylus in kernel config ( CONFIG_INTEL_IPTS=m
> ) , because I tried to use CONFIG_INTEL_IPTS=y to compile and got a error.
> LD init/built-in.o
> drivers/built-in.o: In function `ipts_open_gpu':
> (.text+0x1343c2): undefined reference to `intel_ipts_connect'
> drivers/built-in.o: In function `ipts_close_gpu':
> (.text+0x134435): undefined reference to `intel_ipts_disconnect'
>
> I successed when use CONFIG_INTEL_IPTS=m :
> Kernel: arch/x86/boot/bzImage is ready (#4)
> MODPOST 2349 modules
> LD [M] drivers/gpu/drm/i915/i915.ko
> CC drivers/misc/ipts/intel-ipts.mod.o
> LD [M] drivers/misc/ipts/intel-ipts.ko
>
> So I encountered a question about how to load it .

The simplest way is to build an new iso in android-x86 tree
with your patched kernel.
The module should be auto-loaded on booting
if your device does match with it.
If not, that usually means the driver misses
some alias settings. In the case you can
load it by modprobe as usual:

modprobe intel-ipts

> And is there a way to edit initrd and /system partition and build it ? (
> I've view our website but I found how to custom kernel only.)

Basically you don't need to modify that
if you build the iso as described above.

If you really want to modify initrd maually,
it's easy to find the instructions by google.
To modify /system, just install it as read-write.

> PS : English is not my native language; please excuse typing or grammer
> errors , and notify me If I'am walking on a wrong way.
>
> Thanks everyone :-)

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

YoungJoon Lee

unread,
Jun 24, 2017, 3:26:48 AM6/24/17
to Android-x86
Hello, KenOokamiHoro.

I have a question about your work about NVMe. 
I tried your work.I modify ./out/target/product/x86_64/installer/init But it is overwritten by end of make command. I guess [mkuserimg.sh out/target/product/x86_64/system out/target/product/x86_64/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 0 -D out/target/product/x86_64/system -L system out/target/product/x86_64/root/file_contexts.bin] overwrite it.

How can I apply your code on my system? 
Mount img file and modify init also overwritten by make iso_img command. I have to make isoimg manually. Is there any way to apply your work? 

I also want to found code which is generate init process and modify it. Please share your information. 
Best regards.

2017년 6월 20일 화요일 오후 5시 26분 55초 UTC+9, KenOokamiHoro 님의 말:

YoungJoon Lee

unread,
Jun 24, 2017, 3:46:53 AM6/24/17
to Android-x86
Sorry, I found that init is just copied from /bootable/newinstaller/initrd/init.


2017년 6월 24일 토요일 오후 4시 26분 48초 UTC+9, YoungJoon Lee 님의 말:

KenOokamiHoro

unread,
Jun 25, 2017, 1:55:44 AM6/25/17
to Android-x86
I puted intel-ipts.ko in /lib/modules/<current kernel version/ and try to modprobe it but modprobe only return 255 and not effect lsmod's result 😌.

KenOokamiHoro

unread,
Jun 25, 2017, 3:02:35 AM6/25/17
to Android-x86
http://www.android-x86.org/documents/customizekernel

Use make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig next time? :-)

Chih-Wei Huang

unread,
Jun 26, 2017, 9:42:59 PM6/26/17
to Android-x86
2017-06-25 15:02 GMT+08:00 KenOokamiHoro <kenook...@gmail.com>:
> http://www.android-x86.org/documents/customizekernel
>
> Use make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig next time? :-)

Then build the iso_img as usual.

Chih-Wei Huang

unread,
Jun 26, 2017, 9:50:14 PM6/26/17
to Android-x86
2017-06-23 17:04 GMT+08:00 KenOokamiHoro <kenook...@gmail.com>:
> I puted intel-ipts.ko in /lib/modules/<current kernel version/ and try to
> modprobe it but modprobe only return 255 and not effect lsmod's result .

modprobe need modules.dep to resolve the dependencies.
Manually putting in the module won't generate the
dependencies.
You should build the module as well as the kernel
in the normal building process so modules.dep
is generated automatically.
Or you need to run depmod to generate modules.dep
yourself.

Alternately, use 'insmod path_to_module' to load it.
But you need to resolve all dependencies manually.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages