コード例 #1
0
ファイル: base_linux.py プロジェクト: Flameeyes/muddle
def describe_to(builder):
    """
    Construct a very basic Linux system
    """

    # We want a kernel..
    linux_kernel.simple(builder,
                        name = "kernel",
                        checkout = "kernel-2.6.30-1",
                        linux_dir = "linux-2.6.30",
                        config_file = "kernel_config",
                        kernel_version = "2.6.30",
                        makeInstall = False)

    # Steal a few basic libraries from Debian.
    deb.simple(builder,
               coName = "ubuntu-9.04",
               name = "libc6",
               roles = [ "root" ],
               depends_on = [ ],
               pkgFile = "libc6_2.9.4-ubuntu6_i386.deb")
    deb.simple(builder,
               coName = "ubuntu-9.04",
               name = "libgcc1",
               roles = [ "root" ],
               depends_on = [ "libc6" ],
               pkgFile = "libgcc1_4.3.3-5ubuntu4_i386.deb")

    # If you want networking, you'll need nss too ..
    deb.simple(builder,
               coName = "ubuntu-9.04",
               name = "libnss",
               roles = [ "root" ],
               depends_on = [ "libc6" ],
               pkgFile = "libnss3-1d_3.12.2-rc1-0ubuntu2_i386.deb")
    deb.simple(builder,
               coName = "ubuntu-9.04",
               name = "libnss-mdns",
               roles = [ "root" ],
               depends_on = [ "libc6" ],
               pkgFile = "libnss-mdns_0.10-3ubuntu2_i386.deb")


    # Some shells 'n' stuff :-)
    make.simple(builder,
                name = "busybox",
                roles = [ "root" ],
                checkout = "busybox-1.14.1",
                deps = [ "libc6" ],
                makefileName = "Makefile.muddle")

    make.simple(builder,
                name = "udev",
                roles = [ "root" ],
                checkout = "udev-142",
                deps = [ "libc6" ],
                makefileName = "Makefile.muddle")

    make.simple(builder,
                name = "etc-files",
                roles = [ "root" ],
                checkout = "etc-files",
                deps = [ "libc6" ],
                makefileName = "Makefile.muddle")

    # Not strictly necessary, but let's face it - you're
    # going to want DHCP
    make.simple(builder,
                name = "dhcpcd",
                roles = [ "root" ],
                checkout = "dhcpcd-5.0.4",
                deps = [ ],
                makefileName = "Makefile.muddle")

    # Declare the Ubuntu checkout explicitly, since the
    # deb builder obviously doesn't declare it every
    # time it's used.
    co_simple.relative(builder,
                       "ubuntu-9.04")

    # OK. Deploy the ramdisk
    cpio.deploy(builder, "root.cpio",
                { "root" : "/" },
                "root",
                [ "root" ])

    # Construct a collector to take the cpio archive and kernel
    # we've built and put them somewhere convenient.

    collect.deploy(builder, "firmware")
    collect.copy_from_package_obj(builder,
                                  name = "firmware",
                                  pkg_name = "kernel",
                                  pkg_role = "kernel",
                                  rel = "obj/arch/i386/boot/bzImage",
                                  dest = "vmlinuz")
    collect.copy_from_deployment(builder,
                                 name = "firmware",
                                 dep_name = "root",
                                 rel = "root.cpio",
                                 dest = "initrd",
                                 recursive = False,
                                 copyExactly = False)



    builder.by_default_deploy_list(["root", "firmware"])
コード例 #2
0
ファイル: base_linux.py プロジェクト: crazyscot/muddle
def describe_to(builder):
    """
    Construct a very basic Linux system
    """

    # We want a kernel..
    linux_kernel.simple(builder,
                        name="kernel",
                        checkout="kernel-2.6.30-1",
                        linux_dir="linux-2.6.30",
                        config_file="kernel_config",
                        kernel_version="2.6.30",
                        makeInstall=False)

    # Steal a few basic libraries from Debian.
    deb.simple(builder,
               coName="ubuntu-9.04",
               name="libc6",
               roles=["root"],
               depends_on=[],
               pkgFile="libc6_2.9.4-ubuntu6_i386.deb")
    deb.simple(builder,
               coName="ubuntu-9.04",
               name="libgcc1",
               roles=["root"],
               depends_on=["libc6"],
               pkgFile="libgcc1_4.3.3-5ubuntu4_i386.deb")

    # If you want networking, you'll need nss too ..
    deb.simple(builder,
               coName="ubuntu-9.04",
               name="libnss",
               roles=["root"],
               depends_on=["libc6"],
               pkgFile="libnss3-1d_3.12.2-rc1-0ubuntu2_i386.deb")
    deb.simple(builder,
               coName="ubuntu-9.04",
               name="libnss-mdns",
               roles=["root"],
               depends_on=["libc6"],
               pkgFile="libnss-mdns_0.10-3ubuntu2_i386.deb")

    # Some shells 'n' stuff :-)
    make.simple(builder,
                name="busybox",
                roles=["root"],
                checkout="busybox-1.14.1",
                deps=["libc6"],
                makefileName="Makefile.muddle")

    make.simple(builder,
                name="udev",
                roles=["root"],
                checkout="udev-142",
                deps=["libc6"],
                makefileName="Makefile.muddle")

    make.simple(builder,
                name="etc-files",
                roles=["root"],
                checkout="etc-files",
                deps=["libc6"],
                makefileName="Makefile.muddle")

    # Not strictly necessary, but let's face it - you're
    # going to want DHCP
    make.simple(builder,
                name="dhcpcd",
                roles=["root"],
                checkout="dhcpcd-5.0.4",
                deps=[],
                makefileName="Makefile.muddle")

    # Declare the Ubuntu checkout explicitly, since the
    # deb builder obviously doesn't declare it every
    # time it's used.
    co_simple.relative(builder, "ubuntu-9.04")

    # OK. Deploy the ramdisk
    cpio.deploy(builder, "root.cpio", {"root": "/"}, "root", ["root"])

    # Construct a collector to take the cpio archive and kernel
    # we've built and put them somewhere convenient.

    collect.deploy(builder, "firmware")
    collect.copy_from_package_obj(builder,
                                  name="firmware",
                                  pkg_name="kernel",
                                  pkg_role="kernel",
                                  rel="obj/arch/i386/boot/bzImage",
                                  dest="vmlinuz")
    collect.copy_from_deployment(builder,
                                 name="firmware",
                                 dep_name="root",
                                 rel="root.cpio",
                                 dest="initrd",
                                 recursive=False,
                                 copyExactly=False)

    builder.by_default_deploy_list(["root", "firmware"])
コード例 #3
0
ファイル: 01.py プロジェクト: Flameeyes/muddle
def describe_to(builder):

    role = 'omap'
    roles = ['omap']

    builder.add_default_role(role)

    # filedep.deploy(builder, target_dir, name, roles)
    #
    # Register a file deployment.
    #
    # The deployment will take the roles specified in the role list, and build
    # them into a deployment at deploy/[name].
    #
    # The deployment should eventually be located at target_dir.

    filedep.deploy(builder,
                   '/',
                   'omap',
                   roles)

    # There's a variety of things we need on (this, the host) system
    # in order to build - I hope I've got this right (difficult to tell
    # as I already have some stuff installed on *my* development system)
    aptget.simple(builder, 'development_packages', role,
            ['zlib1g-dev', 'uboot-mkimage'])

    # According to http://omappedia.org/wiki/LinuxOMAP_Kernel_Project, we get
    # our OMAP kernel from:
    muddled.checkouts.simple.absolute(builder, 'omap_kernel',
            'git+git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git')

    # Once we've got one worked out, we'll also want to retrieve a default
    # kernel configuration (we don't, eventually, want to make the developer
    # have to work that out every time!)

    # We'll aim to make that with an out-of-tree makefile
    # We could make a tailored subclass of muddled.pkgs.linux_kernel, and use
    # that to build our kernel. I may still do that once I've figured out how
    # it is different (one notable change is we're building uImage instead of
    # zImage). For now, it's probably easier to have a Makefile.muddle
    make.medium(builder,
                name = "omap_kernel",    # package name
                roles = roles,
                checkout = "builders",
                deps = [],
                makefileName = os.path.join("omap_kernel","Makefile.muddle"))

    muddled.pkg.package_depends_on_checkout(builder.ruleset,
                                    "omap_kernel",  # this package
                                    role,           # in this role
                                    "omap_kernel")  # depends on this checkout

    # On top of that, we want to build busybox
    #
    # According to the busybox website, we can retrieve sources via git:
    #
    # To grab a copy of the BusyBox repository using anonymous git access::
    #
    #   git clone git://busybox.net/busybox.git
    #
    # Once you have the repository, stable branches can be checked out by
    # doing::
    #
    #   git checkout remotes/origin/1_NN_stable
    #
    # Once you've checked out a copy of the source tree, you can update your
    # source tree at any time so it is in sync with the latest and greatest by
    # entering your BusyBox directory and running the command::
    #
    #   git pull

    # So, for the moment, at least, let's go with the latest from source
    # control (when we're finalising this, we're maybe better identifying
    # a particular release to stick to)
    muddled.checkouts.simple.absolute(builder, 'busybox',
            'git+git://busybox.net/busybox.git')

    # We'll aim to make that with an out-of-tree makefile
    #
    # 'deps' is a list of package names, which our make depends on.
    #
    # Specifically, for each <name> in 'deps', and for each <role> in 'roles',
    # we will depend on "package:<name>{<role>}/postinstalled"
    make.medium(builder,
                name = "busybox",    # package name
                roles = roles,
                checkout = "builders",
                deps = [ 'omap_kernel' ],
                makefileName = os.path.join("busybox","Makefile.muddle"))

    # And we also depend on having actually checked out busybox
    muddled.pkg.package_depends_on_checkout(builder.ruleset,
                                    "busybox",      # this package
                                    role,           # in this role
                                    "busybox")      # depends on this checkout


    # Can we use the same bootloader and such that we already had for the
    # android build?

    # The bootloader and related items, which go into the FAT32 partition on
    # the flash card, are retrieved from the net (eventually, I hope we'll be
    # building u-boot, but for now the binary should do)
    muddled.checkouts.simple.absolute(builder, 'MLO',
            'wget+http://free-electrons.com/pub/demos/beagleboard/android/MLO')
    muddled.checkouts.simple.absolute(builder, 'u-boot',
            'wget+http://free-electrons.com/pub/demos/beagleboard/android/u-boot.bin')

    # We need some way of getting them installed - let's foreshadow the day when
    # we actually want to build u-boot ourselves, and pretend
    make.medium(builder,
                name = "u-boot",    # package name
                roles = roles,
                checkout = "builders",
                deps = [],
                makefileName = os.path.join("u-boot","Makefile.muddle"))
    muddled.pkg.package_depends_on_checkout(builder.ruleset,
                                    "u-boot",       # this package
                                    role,           # in this role
                                    "u-boot")       # depends on this checkout
    # Oh, and this one as well...
    rule = muddled.depend.depend_one(None,
                              label_from_string('package:u-boot/installed'),
                              label_from_string('checkout:MLO/checked_out'))
    builder.ruleset.add(rule)


    # And, of course, we need (the rest of) our Linux filesystem
    muddled.checkouts.simple.absolute(builder, 'rootfs',
            'bzr+ssh://[email protected]//opt/kynesim/projects/052/rootfs')
    make.simple(builder, 'rootfs', role, 'rootfs', config=False,
            makefileName='Makefile.muddle')

    # But we depend on busybox to have installed the various binaries first
    rule = muddled.depend.depend_one(None,
                              label_from_string('package:rootfs/installed'),
                              label_from_string('package:busybox/installed'))
    builder.ruleset.add(rule)

    # Deploy all our roles
    builder.by_default_deploy_list(roles)
コード例 #4
0
ファイル: 01.py プロジェクト: crazyscot/muddle
def describe_to(builder):

    role = 'omap'
    roles = ['omap']

    builder.add_default_role(role)

    # filedep.deploy(builder, target_dir, name, roles)
    #
    # Register a file deployment.
    #
    # The deployment will take the roles specified in the role list, and build
    # them into a deployment at deploy/[name].
    #
    # The deployment should eventually be located at target_dir.

    filedep.deploy(builder, '/', 'omap', roles)

    # There's a variety of things we need on (this, the host) system
    # in order to build - I hope I've got this right (difficult to tell
    # as I already have some stuff installed on *my* development system)
    aptget.simple(builder, 'development_packages', role,
                  ['zlib1g-dev', 'uboot-mkimage'])

    # According to http://omappedia.org/wiki/LinuxOMAP_Kernel_Project, we get
    # our OMAP kernel from:
    muddled.checkouts.simple.absolute(
        builder, 'omap_kernel',
        'git+git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git'
    )

    # Once we've got one worked out, we'll also want to retrieve a default
    # kernel configuration (we don't, eventually, want to make the developer
    # have to work that out every time!)

    # We'll aim to make that with an out-of-tree makefile
    # We could make a tailored subclass of muddled.pkgs.linux_kernel, and use
    # that to build our kernel. I may still do that once I've figured out how
    # it is different (one notable change is we're building uImage instead of
    # zImage). For now, it's probably easier to have a Makefile.muddle
    make.medium(
        builder,
        name="omap_kernel",  # package name
        roles=roles,
        checkout="builders",
        deps=[],
        makefileName=os.path.join("omap_kernel", "Makefile.muddle"))

    muddled.pkg.package_depends_on_checkout(
        builder.ruleset,
        "omap_kernel",  # this package
        role,  # in this role
        "omap_kernel")  # depends on this checkout

    # On top of that, we want to build busybox
    #
    # According to the busybox website, we can retrieve sources via git:
    #
    # To grab a copy of the BusyBox repository using anonymous git access::
    #
    #   git clone git://busybox.net/busybox.git
    #
    # Once you have the repository, stable branches can be checked out by
    # doing::
    #
    #   git checkout remotes/origin/1_NN_stable
    #
    # Once you've checked out a copy of the source tree, you can update your
    # source tree at any time so it is in sync with the latest and greatest by
    # entering your BusyBox directory and running the command::
    #
    #   git pull

    # So, for the moment, at least, let's go with the latest from source
    # control (when we're finalising this, we're maybe better identifying
    # a particular release to stick to)
    muddled.checkouts.simple.absolute(builder, 'busybox',
                                      'git+git://busybox.net/busybox.git')

    # We'll aim to make that with an out-of-tree makefile
    #
    # 'deps' is a list of package names, which our make depends on.
    #
    # Specifically, for each <name> in 'deps', and for each <role> in 'roles',
    # we will depend on "package:<name>{<role>}/postinstalled"
    make.medium(
        builder,
        name="busybox",  # package name
        roles=roles,
        checkout="builders",
        deps=['omap_kernel'],
        makefileName=os.path.join("busybox", "Makefile.muddle"))

    # And we also depend on having actually checked out busybox
    muddled.pkg.package_depends_on_checkout(
        builder.ruleset,
        "busybox",  # this package
        role,  # in this role
        "busybox")  # depends on this checkout

    # Can we use the same bootloader and such that we already had for the
    # android build?

    # The bootloader and related items, which go into the FAT32 partition on
    # the flash card, are retrieved from the net (eventually, I hope we'll be
    # building u-boot, but for now the binary should do)
    muddled.checkouts.simple.absolute(
        builder, 'MLO',
        'wget+http://free-electrons.com/pub/demos/beagleboard/android/MLO')
    muddled.checkouts.simple.absolute(
        builder, 'u-boot',
        'wget+http://free-electrons.com/pub/demos/beagleboard/android/u-boot.bin'
    )

    # We need some way of getting them installed - let's foreshadow the day when
    # we actually want to build u-boot ourselves, and pretend
    make.medium(
        builder,
        name="u-boot",  # package name
        roles=roles,
        checkout="builders",
        deps=[],
        makefileName=os.path.join("u-boot", "Makefile.muddle"))
    muddled.pkg.package_depends_on_checkout(
        builder.ruleset,
        "u-boot",  # this package
        role,  # in this role
        "u-boot")  # depends on this checkout
    # Oh, and this one as well...
    rule = muddled.depend.depend_one(
        None, label_from_string('package:u-boot/installed'),
        label_from_string('checkout:MLO/checked_out'))
    builder.ruleset.add(rule)

    # And, of course, we need (the rest of) our Linux filesystem
    muddled.checkouts.simple.absolute(
        builder, 'rootfs',
        'bzr+ssh://[email protected]//opt/kynesim/projects/052/rootfs'
    )
    make.simple(builder,
                'rootfs',
                role,
                'rootfs',
                config=False,
                makefileName='Makefile.muddle')

    # But we depend on busybox to have installed the various binaries first
    rule = muddled.depend.depend_one(
        None, label_from_string('package:rootfs/installed'),
        label_from_string('package:busybox/installed'))
    builder.ruleset.add(rule)

    # Deploy all our roles
    builder.by_default_deploy_list(roles)