[PureOS] Building my own PureOS ISO image?

Jeremiah C. Foster jeremiah.foster at puri.sm
Thu Mar 7 13:18:18 PST 2019


On Wed, 2019-03-06 at 22:04 +0100, Matthias Klumpp wrote:
> Am Mi., 6. März 2019 um 19:56 Uhr schrieb Chris Lamb <
> chris.lamb at puri.sm>:
> > Hi pureos-project,
> > 
> > I'm trying to build a PureOS ISO image on my own system but can't
> > seem
> > to locate a script/repo/documentation, etc

> That should be pretty easy. The basic process is the following (see
> below for replicating almost 100% of what our builders do):

Thanks!

> 1) Create a PureOS green chroot (just debootstrap green and chroot
> into PureOS)
> 1.1) /!\ All following steps happen inside of the PureOS chroot
> 2) Run `apt install live-build git ca-certificates`
> 3) cd /srv && git clone 
> https://source.puri.sm/pureos/infra/make-live.git
> 4) cd /srv/make-live
> 5) Set the FLAVOR environment variable to what flavor of PureOS you
> want to build. Possible values are:
>     * gnome-live
>     * gnome-oem
>     * plasma-live
>    E.g. `export FLAVOR="gnome-oem"`.
>    If no FLAVOR variable is set, the GNOME Live Flavor will be built
> by default
> 6) Run `lb config`

At this step I get an error;  

$ lb config
[2019-03-07 15:31:49] lb config 
P: Executing auto/config script.
Using default flavor: gnome-live
ERROR: Run this first:
ln -sf sid /usr/share/live/build/data/debian-cd/green

I created the symlink and config worked. But I imagine the symlink
needs to be mentioned if I post this on the wiki somewhere?

> 7) Run `lb build`
> 8) Have fun with a fresh new PureOS image!

This worked well, thanks! Now I'll test the resulting ISO and try and
use this process as a start for automated QA.

> These steps can be sped up a lot and be automated by using debspawn,
> which is used to create the official PureOS images in a controlled
> environment.

What does 'controlled' environment mean? The use of apt below leads me
to believe that at least one will have to be on a Debian machine.

I'll test the below method tomorrow.

> In order to use debspawn, just follow these steps:
> 1) Run `sudo apt install debspawn`
> 2) Then run `debspawn create green`
> 3) Create a new "build-pureos.sh" file with the following contents:
> ```
> #!/bin/sh
> set -e
> set -x
> 
> export FLAVOR="gnome-live"
> export DEBIAN_FRONTEND=noninteractive
> apt-get install -y git ca-certificates
> apt-get install -y live-build
> 
> git clone --depth=2 https://source.puri.sm/pureos/infra/make-live.git
> /srv/build/lb
> cd /srv/build/lb/
> 
> lb config
> lb build
> 
> b2sum *.iso *.contents *.zsync *.packages > checksums.b2sum
> sha256sum *.iso *.contents *.zsync *.packages > checksums.sha256sum
> mv *.iso /srv/artifacts
> mv -f *.zsync /srv/artifacts
> mv -f *.contents /srv/artifacts
> mv -f *.files /srv/artifacts
> mv -f *.packages /srv/artifacts
> mv -f *.b2sum /srv/artifacts
> mv -f *.sha256sum /srv/artifacts
> ```
> 4) Make the .sh file executable and set the FLAVOR you want.
> 5) Tell debspawn to run the build and where to place the build
> result:
> `debspawn run --external-command
> --artifacts-out=/where/to/put/the/built/image green
> /path/to/build-pureos.sh`
> 
> This should give you a replica of what our autobuilders did. You can
> also take a look at the actual code in Spark:
> https://github.com/lkorigin/laniakea-spark/blob/master/spark/runners/image_build.py#L30
> 
> I hope this helps :-)

It helps a lot, thanks!

> I was also really sure that I had written this down somewhere already
> (although not in this much detail), but when looking at our Wiki I
> couldn't find it.
> 
> Cheers,
>     Matthias

Jeremiah
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puri.sm/pipermail/pureos-project/attachments/20190307/6c59a135/attachment.sig>


More information about the Pureos-project mailing list