Welcome to Our Website!

The info on this page was "Borrowed/Stolen" from:
            Refer: Difference between breakfast, brunch and lunch

Like a lot of the other items that we have obtained, we think it is good info and do not want to loose it. It is a copy and the "I's" are refering to the Author, Cameron Pickett.   IF, we ever get around to adding anything ourselves, it will be in Red.

   

  Breakfast, Brunch, and Lunch!

One of the questions I had about building source for CyanogenMod was the following:

What's with all these food-named commands like lunch, brunch, and breakfast? What exactly do they do and how do they differ?

I was surprised to find that simply googling these terms did not give a simple, easy to understand explanation (this may not be the case anymore, but it was when I started). I had to search hard to find the answers to my questions and so I figured I'd share my detective work and save you guys the hassle of searching through the pages of search results.

First off, understand that these commands are not found on your system by default. For instance, try opening a terminal right after you start your system and type brunch. Your computer will be confused! "What is brunch?" it will ask; it might even tell you a program that you can download called brunch. Well then, where is brunch? And how does it magically show up when I'm ready to build my image?

You know that command you have to run before you begin your build?

. build/envsetup.sh

That script is what gives you the commands to build the CM source. The script creates "hooks" in the terminal. These hooks intercept any relevant command inputted into the terminal and run the corresponding function found in envsetup.sh. For example, previously when you typed brunch, your computer was confused and didn't know what to do. After running the envsetup.sh script however, your computer now has a hook to follow, which leads it to the function brunch() found in envsetup.sh. I invite you to search the envsetup.sh file for brunch(), it's a rather short function and you will probably be able to figure out what it does. If not, don't worry, I'll explain exactly what these main building functions do right now!

mka

This little gem of a command is basically equivalent to a super-charged version of make. Make is the program that gets called to build our source, choosing the correct compiler for each part of the Android OS that we are making. Problem is, make is SLOW in its default configuration. It can take hours longer depending on your hardware. So what did they do? They mated make with a cheetah, and took their child mka. mka improves upon make by using the program sched_tool to make full use of all the threads available on your machine (For AMD, this is equivalent to the number of cores your processor has; For Intel, this is usually equivalent to twice the number of cores your processor has, due to HyperThreading). What this means is that ALL of your processor is working, not just one small part of it.

breakfast

You may not ever use this command, but in order to explain brunch, we have to explain breakfast first. Breakfast is a function used to configure your build. It keeps track of a list of officially-supported devices to build for, and allows you to choose one. You can do this two ways,

1) breakfast [device name]
 or
2) breakfast (no device name)

The first method is like a shortcut to select your device. If you do not put a device, the script will output a list of available devices to build for, and you can then choose yours. Breakfast then goes on to configure your build environment with the correct variables to create your device-specific rom.

brunch

Defined simply, brunch is equivalent to

breakfast [device name] && mka bacon

This means that it sets up your build environment to be configured for your device, and then commences the build process. mka bacon is just CyanogenMods's way of saying build the code for your device. It's generally only used for officially supported devices (ones that you use can choose through the breakfast menu).

lunch

This ones also pretty simple to explain. It's used EXACTLY like breakfast, the only difference being the choices you have to build with it. Using lunch, you can choose non-official or non-standard builds for your device. This includes special debug versions and also allows you to build CyanogenMod for use on the Android Emulator. To build after running lunch, simply issue the command mka. No bacon here... sorry.


These are only the basics; there are many many more commands made available by envsetup.sh. For a full list, type help after running . build/envsetup.sh. It will list a few with explanations on their use, followed by a full list of all the commands available, many I've never seen nor used before. Try some out and see how they work!