Fork of PureOS make-live.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.8 KiB

2 years ago
  1. # make-live
  2. ## Fork
  3. PureSAUCE fork of PureOS upstream.
  4. https://source.puri.sm/pureos/infra/make-live
  5. ## Building a PureOS ISO image
  6. A set of shell scripts that are used to configure the 'live-build'
  7. tool from Debian specifically for PureOS.
  8. From: Matthias Klumpp <matthias.klumpp@puri.sm>
  9. Date: Wed, 6 Mar 2019 22:04:37 +0100
  10. Subject: Re: [PureOS] Building my own PureOS ISO image?
  11. Message-ID: <CAKNHny8ZXyzAD6fCa0WS2wDs_bxQcO0oKyFns3Q022yuCVkDKw@mail.gmail.com>
  12. > [..]
  13. That should be pretty easy. The basic process is the following (see
  14. below for replicating almost 100% of what our builders do):
  15. 1) Create a PureOS green chroot (just debootstrap green and chroot into PureOS)
  16. 1.1) /!\ All following steps happen inside of the PureOS chroot
  17. 2) Run `apt install live-build git ca-certificates`
  18. 3) cd /srv && git clone https://source.puri.sm/pureos/infra/make-live.git
  19. 4) cd /srv/make-live
  20. 5) Set the FLAVOR environment variable to what flavor of PureOS you
  21. want to build. Possible values are:
  22. * gnome-live
  23. * gnome-oem
  24. * plasma-live
  25. E.g. `export FLAVOR="gnome-oem"`.
  26. If no FLAVOR variable is set, the GNOME Live Flavor will be built by default
  27. 6) Run `lb config`
  28. 7) Run `lb build`
  29. 8) Have fun with a fresh new PureOS image!
  30. These steps can be sped up a lot and be automated by using debspawn,
  31. which is used to create the official PureOS images in a controlled
  32. environment.
  33. In order to use debspawn, just follow these steps:
  34. 1) Run `sudo apt install debspawn`
  35. 2) Then run `debspawn create green`
  36. 3) Create a new "build-pureos.sh" file with the following contents:
  37. ```
  38. #!/bin/sh
  39. set -e
  40. set -x
  41. export FLAVOR="gnome-live"
  42. export DEBIAN_FRONTEND=noninteractive
  43. apt-get install -y git ca-certificates
  44. apt-get install -y live-build
  45. git clone --depth=2 https://source.puri.sm/pureos/infra/make-live.git
  46. /srv/build/lb
  47. cd /srv/build/lb/
  48. lb config
  49. lb build
  50. b2sum *.iso *.contents *.zsync *.packages > checksums.b2sum
  51. sha256sum *.iso *.contents *.zsync *.packages > checksums.sha256sum
  52. mv *.iso /srv/artifacts
  53. mv -f *.zsync /srv/artifacts
  54. mv -f *.contents /srv/artifacts
  55. mv -f *.files /srv/artifacts
  56. mv -f *.packages /srv/artifacts
  57. mv -f *.b2sum /srv/artifacts
  58. mv -f *.sha256sum /srv/artifacts
  59. ```
  60. 4) Make the .sh file executable and set the FLAVOR you want.
  61. 5) Tell debspawn to run the build and where to place the build result:
  62. `debspawn run --external-command
  63. --artifacts-out=/where/to/put/the/built/image green
  64. /path/to/build-pureos.sh`
  65. This should give you a replica of what our autobuilders did. You can
  66. also take a look at the actual code in Spark:
  67. https://github.com/lkorigin/laniakea-spark/blob/master/spark/runners/image_build.py#L30