Sample chromite spec

Change-Id: I049b31c2fc7369fa58ca43e24c2015e574231d7f

BUG=
TEST=none

Review URL: http://codereview.chromium.org/3369009
This commit is contained in:
Anush Elangovan 2010-09-09 15:45:28 -07:00
parent 4903d4354e
commit 050c95cab7
2 changed files with 122 additions and 0 deletions

59
chromite/chromite Executable file
View File

@ -0,0 +1,59 @@
#!/usr/bin/python
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromite"""
import ConfigParser
import optparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))
from cros_build_lib import Die
from cros_build_lib import RunCommand
def chromite_chroot(buildconfig):
pass
def chromite_build(buildconfig):
pass
def chromite_image(buildconfig):
pass
def main():
parser = optparse.OptionParser(usage='usage: %prog [options] build.spec')
parser.add_option('-s', '--spec', default=None,
help='Build Spec to build to')
parser.add_option('-o', '--output-dir', default='./build',
help='Output directory of build')
parser.add_option('-i', '--interactive', default=None,
help='Run in interactive build mode')
(options, inputs) = parser.parse_args()
if not options.spec:
parser.print_help()
Die('Build Spec required')
else:
print "Using build spec.." + options.spec
buildconfig = ConfigParser.SafeConfigParser()
buildconfig.read(options.spec)
for section in buildconfig.sections():
print section
for option in buildconfig.options(section):
print " ", option, "=", buildconfig.get(section, option)
chromite_chroot(buildconfig)
chromite_build(buildconfig)
chromite_image(buildconfig)
if __name__ == '__main__':
main()

View File

@ -0,0 +1,63 @@
# chromite x86-generic target spec file
# Use RFC 822 format
[BUILD]
# If the profile is pulled in from an overlay you will need to specify it.
# Well known locations of the "src/overlays, /usr/local/portage" etc will
# be searched for the overlay
overlay: overlay-x86-generic
# The profile to use for building this target
# ALL is a reserved target that builds all specfiles recursively beneath
# e.g:
# profile: x86-generic/base
profile: x86-generic/dev
# portagechannel speficies which version of the upstream portage is being built
# "stable" is the current stable version
# "unstable" is the next version of portage we are stablizing to
# "bleedingedge" is upto the minute upstream portage
# e.g:
# portagechannel: stable
portagechannel: stable
# prebuilt mirror hosts prebuilts for stage4/chroot and per profile prebuilts
# e.g:
# prebuiltmirror:http://build.chromium.org/mirror/chromiumos/stage4mirror
prebuiltmirror:http://build.chromium.org/mirror/chromiumos/stage4mirror
# stage4 is the Portage Stage3 + any additions deps (hard-host-deps etc)
# "latest" tries to fetch the "latest" from the prebuilt mirror (default)
# -- This is pulled in from the current portagechannel i.e stable
# "nofetch" will prevent fetching stage4 and attempt to compile a stage4
# If nofetch is specified a stage3 and portage are required
# "version" This will attempt to download a particular prebuilt version
# - Version is specfied as s<stage3ver>-p<portagever>
# e.g:
# stage4: stage4-s20100309-p20100310
stage4: latest
# stage3 is the pristine stage3 to use to build your stage4/chroot.
# This is ignored if stage4 is latest
# "latest" fetches the latest version of upstream stage3
# "version" pulls in the specified version of stage3
# e.g:
# stage3: 20100309
stage3: latest
# portage is the upstream portage version to use to build your stage4/chroot.
# "latest" fetches the latest version of upstream portage
# "version" pulls in the specified version of portage
# e.g:
# portage: 20100310
portage: latest
[IMAGE]
# TODO(vince): update the following imaging sections as appropriate.
# TODO(anush): figure out how this can work for virtual ALL targets since
# since each profile will require partition/filesystem/hook information.
p0: ',c,*,,83', 'ext3', '/', 'p0hook'
p1: ',c,*,,82', 'ext2', '/boot', 'p1hook'
p2: ',c,*,,83', 'ext3', '/var', 'p2hook'