Useful links

How to cross bootstrap Baserock to another architecture

Scripts to create a VM

Setup baserock

  • Obtain a Baserock x86_64 VM and log into it. The VM should at least have 4G of RAM, otherwise it may get aborted during building.

  • Upgrade it to devel Baserock following guide

  • Run the following:

    git config --global user.name 'Your Name'
    git config --global user.email 'your.name@codethink.co.uk'
    git config --global push.default simple
    git clone git://git.baserock.org/baserock/baserock/definitions
    cd definitions
    nano systems/cross-bootstrap-system-x86_32-generic.morph
    
  • Add the following:

    arch: x86_32
    description: A system that produces the minimum needed to build a devel system
    kind: system
    name: cross-bootstrap-system-x86_32-generic
    strata:
    - morph: strata/build-essential.morph
    - morph: strata/core.morph
    - morph: strata/cross-bootstrap.morph
    
  • Save and exit

  • Commit the change

    git add systems/cross-bootstrap-system-x86_32-generic.morph
    git commit -a -m"Add a cross bootstrap morph for x86_32"
    
  • Check that the x86_32 architecture is supported (in this case it is)

    cat /usr/lib/python2.7/site-packages/morphlib/__init__.py | grep x86_32
    

Generate a bootstrap Baserock tarball

It will tell where the tarball is stored after building is completed.

  cd /src/definitions
  morph cross-bootstrap x86_32 file:///src/definitions HEAD systems/cross-bootstrap-system-x86_32-generic.morph

Note: 8G RAM or more on the VM is recommended to run the cross-bootstrap, if the RAM is not big enough, the VM may be aborted during the process.

Native build bootstrap system.

  • Copy the tarball to a x86_32 VM, extract the tarball onto a top level of a disk.On the 32bit VM,

    tar -xvf /path/to/store/tarball /path/to/extracted/tarball
    
  • chroot into the fs:

    chroot /path/to/extracted/tarball /bin/sh
    
  • run native-bootstrap script:

    ./native-bootstrap
    

    Note: it will take quite long to run this script, and it won't keep the progress if it has been interrupted. So make sure you won't interrupt it during running. If it does happen, run:

    rm -r /*.dist
    

    to clear directory, and re-run the native-bootstrap scripte.

Prepare bootstrap system to build a devel-system of baserock.

  • Morph uses linux-user-chroot when building, you should be able to run this if it works:

    /path/to/extracted/tarball/usr/bin/linux-user-chroot /path/to/extracted/tarball /bin/sh
    
  • Mount some special filesystems to be used inside the chroot

    cd /path/to/uncompressed/tarball
    mount -t proc proc proc/
    mount -t sysfs sys sys/
    mount -o bind /dev dev/
    mount -o bind /tmp tmp/
    
  • chroot into it

    chroot . /bin/sh
    PATH=/bin:/usr/bin:/sbin:/usr/sbin
    LD_LIBRARY_PATH=/lib:/lib64
    ldconfig
    

Build a devel system

Now you are ready to start using baserock to build and deploy a devel system.

Note: I didn't meet problem on building system, but when deploying, it reported mkfs.btrfs, btrfs and extlinux are missing in bootstarp system. This may be fixed in the future, for the time beings, copy those binaries from host OS will work around it.