Booting Android without framework or GUI

4,782 views
Skip to first unread message

Sagar Shinde

unread,
Nov 3, 2012, 6:17:56 AM11/3/12
to android-...@googlegroups.com
Hi,

For testing of our kernel driver in our production testing, we wanted to boot Android in few seconds (as less as possible).
After flashing images to the device we wanted to test our drivers immediately after Android boot sequence gets completed.
We test out drivers with our own native application which uses framebuffers.

Now since setting up the framework takes most of the time during booting, I am trying to remove framework from the boot sequence.
Also since we use framebuffers for our test applcation we do not need GUI or any other services started by system-server.

To remove framework or GUI from boot sequence I tried stripping Android of system service from boot sequence.
In init.rc, I dint pass "--system-server" parameter when zygote service is started so that system service is not started at all on boot.
But this causes the Android to reboot.

Could anyone please suggest clean way of removing system-server from boot sequence?
Or any other method so that only Android kernel boots up and the framework doesnot bootup during boot sequence?

Thanks,
Sangi

Android007

unread,
Nov 4, 2012, 5:33:51 AM11/4/12
to android-...@googlegroups.com
I am not sure whether this helps you out, but you can always run a headless version of Android if you set:
setprop ro.config.headless "1"

This will remove any calls to SurfaceFlinger, WindowManager etc.

Karim Yaghmour

unread,
Nov 4, 2012, 2:26:35 PM11/4/12
to android-...@googlegroups.com, Sagar Shinde

Two basics options:
- You can disable the Zygote at startup (add the "disabled" parameter to
the service's description in init.rc.)
- Build and run "tiny android": $ BUILD_TINY_ANDROID=true make �j4

--
Karim Yaghmour
CEO - Opersys inc. / www.opersys.com
http://twitter.com/karimyaghmour
> --
> You received this message because you are subscribed to the Google
> Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-platfo...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-platform?hl=en.


Sagar Shinde

unread,
Nov 5, 2012, 4:04:45 AM11/5/12
to Karim Yaghmour, android-...@googlegroups.com
Thanks Karim.

On 4 November 2012 21:26, Karim Yaghmour <karim.y...@opersys.com> wrote:

Two basics options:
- You can disable the Zygote at startup (add the "disabled" parameter to
the service's description in init.rc.)
- Build and run "tiny android": $ BUILD_TINY_ANDROID=true make 虻4

Hari C R

unread,
Mar 8, 2017, 10:33:54 AM3/8/17
to android-platform, sang...@gmail.com
Hi 

I was following steps from here https://github.com/gibsson/headless-android

and ran into the error below when executed "make"

============================================
[38/38] bootstrap out/soong/.minibootstrap/build.ninja.in
[4/4] cp out/soong/.bootstrap/bin/bpglob
[331/332] glob vendor/*/*/Android.bp
[40/40] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
out/build-mini_headless.ninja is missing, regenerating...
Checking build tools versions...
build/core/dex_preopt.mk:69: warning: target `out/target/product/headless/dex_bootjars/system/framework/core' doesn't match the target pattern
build/core/dex_preopt.mk:69: error: target pattern contains no '%'.
19:10:57 ckati failed with: exit status 1
make: *** [run_soong_ui] Error 1

#### make failed to build some targets (03:48 (mm:ss)) ####

Hari C R

unread,
Mar 10, 2017, 6:53:05 PM3/10/17
to android-platform, sang...@gmail.com
Hi Karim

I was following steps from here https://github.com/gibsson/headless-android

and ran into the error below when executed "make"

============================================
[38/38] bootstrap out/soong/.minibootstrap/build.ninja.in
[4/4] cp out/soong/.bootstrap/bin/bpglob
[331/332] glob vendor/*/*/Android.bp
[40/40] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
out/build-mini_headless.ninja is missing, regenerating...
Checking build tools versions...
build/core/dex_preopt.mk:69: warning: target `out/target/product/headless/dex_bootjars/system/framework/core' doesn't match the target pattern
build/core/dex_preopt.mk:69: error: target pattern contains no '%'.
19:10:57 ckati failed with: exit status 1
make: *** [run_soong_ui] Error 1

#### make failed to build some targets (03:48 (mm:ss)) ####

Do you have any idea why its failing 

Thanks,

On Monday, 5 November 2012 00:56:35 UTC+5:30, Karim Yaghmour wrote:

Yafei Liu

unread,
Mar 10, 2017, 6:53:15 PM3/10/17
to android-...@googlegroups.com, sang...@gmail.com
Long long ago AOSP did support a headless build in the build system which contains no UI with a BUILD_TINY_ANDROID. How ever, in android 4.0 (or earlier? Can't remember), google fully removed this feature. I'v noticed that the lasted modify in the git is 3 years later, and you did not mention the version of your AOSP, I assumed that you code does not support this feature any more.

To unsubscribe from this group and stop receiving emails from it, send an email to android-platform+unsubscribe@googlegroups.com.
To post to this group, send email to android-platform@googlegroups.com.
Visit this group at https://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.

Gary Bisson

unread,
Mar 23, 2017, 10:49:08 AM3/23/17
to android-platform, sang...@gmail.com
Hi Hari,


On Saturday, March 11, 2017 at 12:53:05 AM UTC+1, Hari C R wrote:
Hi Karim

I was following steps from here https://github.com/gibsson/headless-android

and ran into the error below when executed "make"

============================================
[38/38] bootstrap out/soong/.minibootstrap/build.ninja.in
[4/4] cp out/soong/.bootstrap/bin/bpglob
[331/332] glob vendor/*/*/Android.bp
[40/40] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
out/build-mini_headless.ninja is missing, regenerating...
Checking build tools versions...
build/core/dex_preopt.mk:69: warning: target `out/target/product/headless/dex_bootjars/system/framework/core' doesn't match the target pattern
build/core/dex_preopt.mk:69: error: target pattern contains no '%'.
19:10:57 ckati failed with: exit status 1
make: *** [run_soong_ui] Error 1

#### make failed to build some targets (03:48 (mm:ss)) ####

Do you have any idea why its failing 

As the README of the repo says: "those patches have been made for Android 4.4_r1".

Since then, the ro.config.headless variable has been remove from the AOSP so this repo doesn't apply any more.

Hope this helps.

Regards,
Gary
Reply all
Reply to author
Forward
0 new messages