boot process init source and process

216 views
Skip to first unread message

Sam Lin

unread,
Jan 31, 2013, 9:43:29 AM1/31/13
to chromium-...@chromium.org
Hi Developers,

Here is my two questions:

First; Since the file in /sbin/init is a binary,
         From what I know, when the kernel starts, the /sbin/init will also been executed until it kicks of chromeos_startup(The upstart will handle the rest part of all init things)
         However, i have no idea about what services and tasks have been invoked before the init to kick of chromeos_startup and when is chromeos_startup exactly to be kicked
         off? The process procedure I have found is /sbin/init execute /etc/init/startup.conf, and startup.conf execute chromeos_startup, however, this is very vague for me to know
         the real truth and i am not even so sure this is correct (Let me know if i am wrong at this point).
         I have spent lot of time trying to trace the code but I can barely find any clue about the init source in the Chromium OS project. Did I miss downloading anything?

Second: when I ran the command build_package or build_image. I looked into the log but not able to find something I need like the information of cross_compile.
             Is there any debug flag I can turn on to have more detail information? If so, how?


Thanks for your reply in advance.



Regards-

Richard Barnette

unread,
Jan 31, 2013, 12:02:15 PM1/31/13
to ckjbo...@gmail.com, chromium-...@chromium.org
On Jan 31, 2013, at 6:43 AM, Sam Lin <ckjbo...@gmail.com> wrote:

> Hi Developers,
>
> Here is my two questions:
>
> First; Since the file in /sbin/init is a binary,
> From what I know, when the kernel starts, the /sbin/init will also been executed until it kicks of chromeos_startup(The upstart will handle the rest part of all init things)

First key point: /sbin/init *is* Upstart. (N.B. Better wording would be
"Upstart is an implementation of /sbin/init"). To read and understand
the Chromium OS user land boot sources, you'll need to understand
Upstart.

Upstart documentation is available inside the chroot; say this:
man 5 init

There's documentation online, too; a Google search will find it.


> However, i have no idea about what services and tasks have been invoked before the init to kick of chromeos_startup and when is chromeos_startup exactly to be kicked
> off? The process procedure I have found is /sbin/init execute /etc/init/startup.conf, and startup.conf execute chromeos_startup, however, this is very vague for me to know
> the real truth and i am not even so sure this is correct (Let me know if i am wrong at this point).
> I have spent lot of time trying to trace the code but I can barely find any clue about the init source in the Chromium OS project. Did I miss downloading anything?
>
The man page covers what happens when /sbin/init starts.
The short summary for Chromium OS is that chromeos_startup
is among the first jobs kicked off by init.

The Chromium OS sources for the key upstart jobs that drive the boot flow are
in src/platform/init. See particularly these jobs:
startup
boot-services
system-services
ui

There's been discussion on the topic before on this mailing list. You can
find the conversation if you search on Google for "chrome os boot flow".


> Second: when I ran the command build_package or build_image. I looked into the log but not able to find something I need like the information of cross_compile.
> Is there any debug flag I can turn on to have more detail information? If so, how?
>
>
> Thanks for your reply in advance.
>
>
>
> Regards-
>
> --
> Chromium OS discuss mailing list: chromium-...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-discuss?hl=en

-- jrb



Sam Lin

unread,
Jan 31, 2013, 7:51:22 PM1/31/13
to chromium-...@chromium.org
Hi Richard,

Thanks for the reply.

Do you have any idea about my second question?

Be more specific, if we make linux kernel, we can use "make V=1" to have more information.

Does Chromium OS also provider the verbal mode during compiling process?


Sam Lin於 2013年1月31日星期四UTC+8下午10時43分29秒寫道:

Mike Frysinger

unread,
Jan 31, 2013, 11:11:18 PM1/31/13
to ISheng Lin, Chromium OS discuss
when you run `emerge-$BOARD <foo>`, it tells you the exact `make`
command used to build

you could also do `MAKEOPTS="V=1" emerge-$BOARD <foo>` to pass flags to make
-mike

Sam Lin

unread,
Feb 3, 2013, 7:40:12 AM2/3/13
to chromium-...@chromium.org, ISheng Lin
hi Mike,

when I run (in chroot and I run "export BOARD=arm-generic" first ) emerge-$BOARD <arm-generic>

it pops up an error. I did not understand the meaning of <foo> and I then assumed to pass the board specific such as <arm-generic>.

Please correct me the usage of this command. Thank you. 

Mike Frysinger於 2013年2月1日星期五UTC+8下午12時11分18秒寫道:

Mike Frysinger

unread,
Feb 3, 2013, 12:09:55 PM2/3/13
to ISheng Lin, Chromium OS discuss
replace <foo> with the name of the package, not the board
-mike

Sam Lin

unread,
Feb 4, 2013, 4:40:01 AM2/4/13
to chromium-...@chromium.org, ISheng Lin
Thanks. I went through the build_package.sh and what happen if


DEFINE_boolean showoutput "${FLAGS_TRUE}" \
  "Show all output from parallel_emerge."


I set this flag to true.

I actually set this flag to true but it seems nothing change. I guess I need to have a comment like "make clean".

Is there any comment I can enter for executing "make clean" in chroot?

Based on the replies, can I say that all necessary packages for booting chromeOS are built up by "emerge" command?



Regards-

Mike Frysinger於 2013年2月4日星期一UTC+8上午1時09分55秒寫道:

Mike Frysinger

unread,
Feb 4, 2013, 5:53:47 AM2/4/13
to ISheng Lin, Chromium OS discuss
i have no idea what it is you're trying to do. there is no need to
`make clean` for a specific package since `emerge <package>` builds it
from scratch every time. if you want to delete all the stuff you
built for a board and start over, run setup_board with the --force
option. it will blow away the entire build dir for that board.
-mike

Sam Lin

unread,
Feb 4, 2013, 9:38:47 AM2/4/13
to chromium-...@chromium.org, ISheng Lin
My intention is to port Chromium OS to an arm development board.

So far I can enter the linux shell mode which means the u-boot and kernel should not have the problem to boot Chromium OS.

I skip the verified boot function in the u-boot and kernel because my first target is to bring up the Chromium OS.

The reason why i asked these questions because:

1. Once the kernel executed, the /sbin/init will kick of the chromeos_startup,
    There are lot of services/tasks to be invoked for booting the Chromium OS.
    To be familiar with the system, I have to know the detail of what services/tasks to be invoked
    and what packages to be installed onto the image.
    By this way, I can add these packages/services to my own system to bring up Chromium OS on my board successfully.

I have not figured out how to invoke these services and how to add these packages to my own systems but I am sure I must know

these things(packages/services) first. Only after figuring out these information, i can process to the next step.

Please let me know if my direction is incorrect and any comment will be highly appreciated.


Regards-

Mike Frysinger於 2013年2月4日星期一UTC+8下午6時53分47秒寫道:
Message has been deleted

Sam Lin

unread,
Feb 6, 2013, 8:18:02 AM2/6/13
to chromium-...@chromium.org, ISheng Lin
I think I have figured out how to use these commands to see the detail. Thanks Mike.

However, i was thinking to have more detail information when i execute the build_package script.

Does build_package script support building in verbose mode? In this case, i can have more information

thanks

Mike Frysinger於 2013年2月1日星期五UTC+8下午12時11分18秒寫道:

Mike Frysinger

unread,
Feb 6, 2013, 12:12:20 PM2/6/13
to ISheng Lin, Chromium OS discuss
no, build_packages doesn't include a verbose mode. this is because
it's building multiple packages in parallel, so seeing N packages
(where N == number of CPUs by default) all displaying their
configure/make/etc... output intertwined is almost entirely pointless.
you might be able to make an argument for allowing verbose mode if
someone passed --jobs 1, but that's such an uncommon edge case that
it's pointless. you might as well run `emerge-$BOARD <pkg>` yourself
imo.

however, it tells you while it's building where the log output is
being saved (in /tmp/xxxx and such). once it finishes, it archives
the log in /build/$BOARD/tmp/portage/logs/.
-mike

Trever

unread,
Mar 1, 2013, 6:43:28 PM3/1/13
to chromium-...@chromium.org
Hi Sam,

If it still matters to you, looking at my own notes, I think the prior discussion Richard is talking about is here:

Trever

Sam Lin

unread,
Mar 1, 2013, 11:07:40 PM3/1/13
to chromium-...@chromium.org
Hi Trever,

Thanks. I think I have no further questions with this topic. Porting Chromium OS to my dev board is on top of my priority list. :-)

Trever於 2013年3月2日星期六UTC+8上午7時43分28秒寫道:
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages