Jump to content











Photo
- - - - -

Android x86 booting from LAN, PXE !!

android x86 kitkat pxe nfs server boot pxe

  • Please log in to reply
27 replies to this topic

#1 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 11 July 2014 - 07:07 PM

android-x86.jpg

 

Hello, this is a Brainstorm post !

 

Anyone try new version of Android x86 4.4 RC2 booting from LAN ? (pxe)

 

Imagine running Android in your PCS CyberCafé ? Its a very easy system and its very popular. Have all the social apps, email, wordprocessing and lot of tools ! 

 

Recently the Android x86 project launch the new version of port 4.4

 

 

Here a post from the members of Android x86 group that trying this method:

https://groups.googl...0g/Tyv7AJHbP1wJ

 

Actualy the system have few imcompatibles with some video cards yet, but you can try.

 

Another interesting project of Android for x86 that will be lanch soon is ConsoleOS:  http://consoleos.com/  ( not launched yet).

 

Any other market of Android on desktops is HP Slate 21, its a interesting computer with Android OS.

 

 

Well, im starting trying to make the PXE Boot of android x86 to work, so i will share some tools im using to know the system and open the files (.ISO image, and SFS files ), if you will work in a Windows Dekstop to make this possible.

 

Any help will be appreciated guys !

 

 

To start:

 

1 - Download Android x86 4.4 RC2 from the "Android x86 Project website", read carefully the 'Know issues' from the page. 

 

2 - Install the Android x86 onto the Virtuabox, create a virtual machine, create the disk in a .VHD format, and install with a ext3 filesystem option.

 

Prepare your Windows with tools:

 

3  - Download EXT2FSD:  http://sourceforge.n.../files/Ext2fsd/  , this tool will turn your Windows capable to know ext2,ext3 partitions;

 

4 - Download the OSFMount tool,  http://www.osforensi...isk-images.html, after your system know the ext2 and ext3 partitions, OSFMount can mount the system images of Android.

 

5 - Download 7zip , with 7zip you can open initrd file, because this file is .tar.gz format;

 

6 - notepad++: http://notepad-plus-plus.org/download/  , best editor for text and configurator files;

 

 

7 - Download bsRoot.rar : http://www.mediafire...05p6/bsRoot.rar   , with this package you can expand/decompress system.sfs file with unSquashfs.bat

 

 

Another tip to learn more about the Android x86 structure and how to open your files is this video:

 

https://www.youtube....h?v=olMC90P_xhk

 

 

NFS Mount command line for ANDROID example:

 

#> busybox mount -o nolock,ro,hard,intr,vers=3 -t nfs 192.xxx.xxx.x.x:/your/nfs/share /mnt/sdcard/YourLocalFolder

 

 

 

 

 

 


  • Nuno Brito and abozeeyad like this

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • Team Reboot
  • 10452 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 11 July 2014 - 07:20 PM

@rebit, this is a great post. Plenty of information on interesting tools I haven't tried yet. :cheers:


  • rebit likes this

#3 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 11 July 2014 - 07:31 PM

Hi Rebit,

 

Nice to see you back.

I tried sometime ago to pxe boot Android X86 but failed.

 

However, with all the good links to gave above, I see that as a new challenge :)

 

Regards,

Erwan


  • rebit likes this

#4 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 11 July 2014 - 08:29 PM

The Android x86 4.4 RC2 iso opened in WinRAR:

hkr5Drf.png?1?7533

 

 

Expanding system.sfs  with Unquashfs.bat from bsRoot.rar package:

 

DV5oEbO.png

 

The result, the original file has 332 Mb, expanding 720 Mb !

 

rGsNkau.png

 

 

 

Now you can mount with OSFMount tool:

 

AMDB4YF.jpg

 

 

Now you can see all the Android System strutucture Folder ! You can insert .apk files (applications) inside the "app" folder. When android is installed all the packages will be installed automatically and silent !

9JOwwmG.jpg

 

About INITRD, as you can see in the Google Groups of Android x86 has a new initrd patch to be applied to enable NFS Root boot !

 

Im trying to apply in Windows this 'patch', now i have no sucess...

To Open initrd.img just use 7zip, extract initrd to a folder, after reopen extracted file inside 7zip again and extract all file to same folder.

You will see the 'initrd' file to be edited into notepad++.

 

 

TXEve9a.jpg

 

 

 

Now i need to apply the patch from : https://groups.googl...=0.1&authuser=0

 

To repackage initrd in Windows, use 7zip, select all folders of 'initrd' and make a tar first (initrd.tar), after compress with gzip method in 7zip, rename the file to initrd.img and put inside the CD image.

 

To redisign the Android CD image, im using PowerISO tool.


Edited by rebit, 11 July 2014 - 08:36 PM.

  • Nuno Brito likes this

#5 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 11 July 2014 - 09:31 PM

What software are you using to apply your patch (a diff file) to the initrd?

I am the sure the good guys out there can suggest one software or method to perform this task under windows.

 

/Erwan



#6 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 11 July 2014 - 09:34 PM

Hi Erwan, im trying to apply the patch with Windows right now... I dont know how to do yet...

 

Maybe 'git' tool ? https://www.youtube....h?v=Yta7wwmbJ68

 

or

 

http://gnuwin32.sour...kages/patch.htm

 


Edited by rebit, 11 July 2014 - 09:38 PM.


#7 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 11 July 2014 - 09:38 PM

I would do it manually, the ulgy way :)

 

Open the original initrd,

 

1) the try_mount procedure should look like this after changes :

 

try_mount()
 {
  RW=$1; shift
 if [ "${ROOT#*:/}" != "$ROOT" ]; then
 # for NFS roots, use nolock to avoid dependency to portmapper
 RW="nolock,$RW"
 fi
 # FIXME: any way to mount ntfs gracefully?
 mount -o $RW $@ || mount.ntfs-3g -o rw,force $@
 }
 
2) Same goes with the remount_rw
 
remount_rw()
 {
# "foo" as mount source is given to workaround a Busybox bug with NFS
# - as it's ignored anyways it shouldn't harm for other filesystems.
mount -o remount,rw foo /mnt
 }

  • rebit likes this

#8 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 11 July 2014 - 09:46 PM

Now its time to use Tiny PXE Server and WinNFSd-2.0 ! :D



#9 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 11 July 2014 - 09:54 PM

which pxe boot strapper you use? pxelinux? ipxe?

 

with ipxe it would be something like this 

#!ipxe
set boot-url http://${next-server}
set nfs-server ${next-server}
kernel ${boot-url}/android/kernel ip=dhcp root=/dev/nfs rw nfsroot=${nfs-server}:/path/to/android-x86/out/target/product/generic_x86/installer/ DEBUG=1
initrd ${boot-url}/android/initrd.img
boot

  • rebit likes this

#10 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 11 July 2014 - 09:57 PM

Is working (booting) for you right now ? I like ipxe too !

 

 

 

which pxe boot strapper you use? pxelinux? ipxe?

 

with ipxe it would be something like this 

#!ipxe
set boot-url http://${next-server}
set nfs-server ${next-server}
kernel ${boot-url}/android/kernel ip=dhcp root=/dev/nfs rw nfsroot=${nfs-server}:/path/to/android-x86/out/target/product/generic_x86/installer/ console=ttyS4,115200 DEBUG=1
initrd ${boot-url}/android/initrd.img
boot


#11 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 11 July 2014 - 10:02 PM

Is working (booting) for you right now ? I like ipxe too !

 

Did not try out yet (need to get a test laptop from  my garage...).

But this is planned for this week end !

 

I enjoyed following your steps this :)

 

1-extract the system.sfs from the ISO

2-extract the system.img from the SFS

3-modify the initrd in the init

4-pxe boot !

 

Although I prefer it is may be better to stick to pxelinux as the guys on the google thread and also because the iso seems to be built with isolinux.


  • rebit likes this

#12 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 11 July 2014 - 10:06 PM

I will try all night to boot, if i finish i will post the result here ! thanks Erwan !



#13 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 11 July 2014 - 10:12 PM

in comming !!  :blink: almost.... working...

5TAd9JK.jpg



#14 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 12 July 2014 - 04:22 AM

no luck yet, the kernel cannot set the ip from dhcp during boot, no network after initrd booting.

 

 

this parameter is not working for me: ip=dhcp



#15 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 12 July 2014 - 04:26 AM

errata: To remake the initrd on windows you should get  WinTar, not 7zip...

 

"To Open initrd.img just use 7zip, extract initrd to a folder, after reopen extracted file inside 7zip again and extract all file to same folder."

 

initrd = cpio + gzip 

 

so the tool: http://en.kioskea.ne...oad-3199-wintar  , i think is a abandonware. But works fine to rebuild initrd in Windows env.



#16 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 12 July 2014 - 12:41 PM

no luck yet, the kernel cannot set the ip from dhcp during boot, no network after initrd booting.

 

 

this parameter is not working for me: ip=dhcp

 

About the parameter not being taken into account, it could be an issue with ipxe not passing parameters correctly (just an hypothesis).

Stick to pxelinux to start with.

prompt 1
timeout 50
default android

label android
        kernel kernel
        append androidboot.hardware=android_x86 video=-16 ip=dhcp root=/dev/nfs rw nfsroot=192.168.0.100:/path/to/android-x86/out/target/product/generic_x86/installer/ DEBUG=1 initrd=initrd.img

  • rebit likes this

#17 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 12 July 2014 - 06:37 PM

About SquashFS for Windows, you can find patches and binaries for different versions (latest being 4.0) here.

 

About OSF Mount, you can also use ImDisk to mount this logical/partition image.


  • rebit likes this

#18 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 12 July 2014 - 07:22 PM

 

I would do it manually, the ulgy way :)

 

Open the original initrd,

 

1) the try_mount procedure should look like this after changes :

 

try_mount()
 {
  RW=$1; shift
 if [ "${ROOT#*:/}" != "$ROOT" ]; then
 # for NFS roots, use nolock to avoid dependency to portmapper
 RW="nolock,$RW"
 fi
 # FIXME: any way to mount ntfs gracefully?
 mount -o $RW $@ || mount.ntfs-3g -o rw,force $@
 }
 
2) Same goes with the remount_rw
 
remount_rw()
 {
# "foo" as mount source is given to workaround a Busybox bug with NFS
# - as it's ignored anyways it shouldn't harm for other filesystems.
mount -o remount,rw foo /mnt
 }

 

 

Looking at the last iso I downloaded, it looks as if the patch to initrd as already been applied so there should be no need to modify it.


  • rebit likes this

#19 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 14 July 2014 - 05:29 PM

Yes, you right... 

 

Tonight i will test with pxelinux.0 , i think ip=dhcp parameter is not reconized by ipxe too.  



#20 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 15 July 2014 - 05:32 AM

no lucky, first need recompile the android kernel to boot with NFS support ! I need to learn how to recompile the Android x86 kernel.



#21 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 15 July 2014 - 01:04 PM

no lucky, first need recompile the android kernel to boot with NFS support ! I need to learn how to recompile the Android x86 kernel.

 

Interesting.

The google thread does not mention this : where did you get that info?

 

For now, when booting other pxelinux, I get stuck on "detecting android-x86" with lots of dots after ...

It never get to the point where it claims an IP and reaches my nfs server.

 

Booting the iso thus works fine so I know my hardware (whether physical or vbox) support this distro.

 

I am no linux expert but I believe the boot process is the following (wikipedia) :

system startup->boot loader stage 1->boot loader stage 2->kernel->init.

In our case, the boot loader is actually pxelinux.

 

I believe I never reach the init so far and therefore do not mount the nfs share.

I believe this is also the init setting up the network.

 

Regards,

Erwan


  • rebit likes this

#22 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 15 July 2014 - 05:18 PM

I have the same problem, init not gets ip from network...  

 

About the rebuild the kernel i read on the same thread, but not from the original owner of post...I'm not sure.

 

Im ping the ip that pxe get on boot, and when the init loads the IP no up...

 

 

I'll keep trying to post any developments here.


Edited by rebit, 15 July 2014 - 05:47 PM.


#23 rebit

rebit

    Member

  • Members
  • 63 posts
  • Interests:Boot PXE , Grub4dos, Windows 7 entire in RAMDISK
  •  
    Brazil

Posted 15 July 2014 - 07:44 PM

Erwan, did you saw this:

 

https://01.org/andro...oid-4.4.2r1-ia0



#24 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 15 July 2014 - 07:56 PM

I have the same problem, init not gets ip from network...  

 

About the rebuild the kernel i read on the same thread, but not from the original owner of post...I'm not sure.

 

Im ping the ip that pxe get on boot, and when the init loads the IP no up...

 

 

I'll keep trying to post any developments here.

 

Pinging the ip that pxe gets is normal : at this point your pxe boot strapper has an ip and is on the network.

Then it will load the kernel which in turn will gets its own ip.

 

This applies to all pxe boot whatever system you use : pxe bootstrapper gets an ip, then your kernel O.S gets another one.



#25 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1975 posts
  • Location:Nantes - France
  •  
    France

Posted 15 July 2014 - 07:58 PM

Erwan, did you saw this:

 

https://01.org/andro...oid-4.4.2r1-ia0

 

Android-IA only supports booting on UEFI mode.

 

For now, I would stay away from UEFI : UEFI alone is already a serious pain in the ass, added to PXE boot, it becomes a nightmare.

I dont even want to imagine what it does when adding Android + PXE Boot + UEFI : Sounds like headaches too me :)


  • rebit likes this





Also tagged with one or more of these keywords: android x86, kitkat, pxe, nfs server, boot pxe

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users