Skip to content

Commit db7c039

Browse files
davidmhewittkgrubb
authored andcommitted
Make Debian live-build scripts the default (elementary#243)
* Out with the old * Initial checkin of Debian live-build based workflows * Get the CI scripts ready * Upload path fixes * Hide GRUB title * Remove github workflows folder * Add header to README * Add build steps to README * Separate build and upload scripts * Update README build instructions * Fix filename suffix * Drop Ubiquity patch * Simplify GRUB config * Upload logo for grub theme * Rename grub theme * Remove syslinux splash, add timeout * More bootloader theme improvements * Try to switch to plain isolinux menu * Switch live list to metapackage * Add support for multiple package list folders * Add initial setup to distinst packages * Simplify isolinux config * Set up workflow files * Move all the in-depth detail out of the readme * Add link to wiki * Fix formatting of stable workflow file * Switch to container syntax * Remove docker -i flag
1 parent c51e7fe commit db7c039

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+546
-569
lines changed

.github/workflows/daily-alternative.yml

-29
This file was deleted.

.github/workflows/daily.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13+
container:
14+
image: debian:latest
15+
volumes:
16+
- /proc:/proc
17+
options: --privileged
18+
1319
steps:
14-
- name: Clone
20+
- name: Clone build scripts
1521
uses: actions/checkout@v1
1622

17-
- name: Build
18-
run: sudo ./workflows.sh daily 5.0 "${{ secrets.key }}" "${{ secrets.secret }}" "${{ secrets.endpoint }}" "${{ secrets.bucket }}"
23+
- name: Build and upload daily .iso
24+
run: |
25+
mkdir /artifacts
26+
./workflows.sh etc/terraform-juno-daily-azure.conf "${{ secrets.key }}" "${{ secrets.secret }}" "${{ secrets.endpoint }}" "${{ secrets.bucket }}"

.github/workflows/stable.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11-
steps:
12-
- name: Clone
13-
uses: actions/checkout@v1
11+
container:
12+
image: debian:latest
13+
volumes:
14+
- /proc:/proc
15+
options: --privileged
1416

15-
- name: Build
16-
run: sudo ./workflows.sh stable "$GITHUB_REF" "${{ secrets.key }}" "${{ secrets.secret }}" "${{ secrets.endpoint }}" "${{ secrets.bucket }}"
17+
steps:
18+
- name: Clone build scripts
19+
uses: actions/checkout@v1
1720

21+
- name: Build and upload stable .iso
22+
run: |
23+
mkdir /artifacts
24+
./workflows.sh etc/terraform-juno-stable-azure.conf "${{ secrets.key }}" "${{ secrets.secret }}" "${{ secrets.endpoint }}" "${{ secrets.bucket }}"

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.vagrant
2-
ubuntu-*.log
31
.DS_Store
42
tmp
5-
builds
3+
artifacts
4+
*~

README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,33 @@
2020

2121
## Building Locally
2222

23-
To build an elementary OS image you'll need to:
23+
As elementary OS is built with the Debian version of `live-build`, not the Ubuntu patched version, it's easiest to build an elementary .iso in a Debian VM or container. This prevents messing up your host system too.
2424

25-
1) Make sure you have the following dependencies installed:
25+
The following example uses Docker and assumes you have Docker correctly installed and set up:
2626

27-
* `dctrl-tools`
28-
* `dpkg-dev`
29-
* `genisoimage`
30-
* `gfxboot-theme-ubuntu`
31-
* `isolinux`
32-
* `live-build`
33-
* `squashfs-tools`
34-
* `syslinux`
35-
* `syslinux-utils`
36-
* `zsync`
37-
38-
2) Clone this project & `cd` into it:
27+
1) Clone this project & `cd` into it:
3928

4029
```
4130
git clone https://github.com/elementary/os && cd os
4231
```
4332
44-
3) Configure the channel in the `etc/terraform.conf` (stable, daily).
33+
2) Configure the channel in the `etc/terraform.conf` (stable, daily).
4534
46-
4) Run the build script as a root user:
35+
3) Run the build:
4736
4837
```
49-
./terraform.sh
38+
mkdir artifacts
39+
docker run --privileged -i \
40+
-v /proc:/proc \
41+
-v ${PWD}/artifacts:/artifacts \
42+
-v ${PWD}:/working_dir \
43+
-w /working_dir \
44+
debian:latest \
45+
/bin/bash -s etc/terraform.conf < build.sh
5046
```
5147
52-
5) When done, your images will be in the builds folder.
48+
4) When done, your image will be in the `artifacts` folder.
49+
50+
## Further Information
51+
52+
More information about the concepts behind `live-build` and the technical decisions made to arrive at this set of tools to build an .iso can be found [on the wiki](https://github.com/elementary/os/wiki/Building-iso-Images).

Vagrantfile

-9
This file was deleted.

build.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
CONFIG_FILE="$1"
4+
5+
source "$CONFIG_FILE"
6+
7+
echo -e "
8+
#----------------------#
9+
# INSTALL DEPENDENCIES #
10+
#----------------------#
11+
"
12+
13+
apt-get update
14+
apt-get install -y live-build patch
15+
16+
patch -d /usr/lib/live/build/ < live-build-fix-syslinux.patch
17+
18+
echo -e "
19+
#----------------------#
20+
# RUN TERRAFORM SCRIPT #
21+
#----------------------#
22+
"
23+
24+
./terraform.sh --config-path "$CONFIG_FILE"
25+
cp builds/amd64/* /artifacts/

etc/auto/clean

-10
This file was deleted.

etc/auto/config

+45-22
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,57 @@
1-
#! /bin/sh
1+
#!/bin/sh
2+
23
set -e
34

45
. ./terraform.conf
56

6-
HOOKS="update-apt-file-cache update-apt-xapian-index update-mlocate-database remove-dbus-machine-id remove-openssh-server-host-keys remove-udev-persistent-rules"
7+
# HWE starts with y, Y or 1?
8+
if [ "$HWE" = "yes" ]; then
9+
KERNEL_FLAVORS="generic-hwe-${BASEVERSION}"
10+
XORG_HWE="xserver-xorg-hwe-${BASEVERSION}"
11+
else
12+
KERNEL_FLAVORS="generic"
13+
fi
714

815
lb config noauto \
9-
--architecture "$ARCH" \
10-
--binary-images iso-hybrid \
11-
--bootloader syslinux \
12-
--keyring-packages ubuntu-keyring \
13-
--build-with-chroot false \
16+
--architectures "$ARCH" \
17+
--mode ubuntu \
18+
--initramfs none \
1419
--distribution "$BASECODENAME" \
15-
--hooks "$HOOKS" \
20+
--parent-distribution "$BASECODENAME" \
21+
--archive-areas "main restricted universe multiverse" \
22+
--parent-archive-areas "main restricted universe multiverse" \
23+
--linux-packages linux-image \
24+
--linux-flavours "$KERNEL_FLAVORS" \
25+
--bootappend-live "boot=casper maybe-ubiquity quiet splash" \
26+
--mirror-bootstrap "$MIRROR_URL" \
27+
--parent-mirror-bootstrap "$MIRROR_URL" \
28+
--mirror-chroot-security "http://security.ubuntu.com/ubuntu/" \
29+
--parent-mirror-chroot-security "http://security.ubuntu.com/ubuntu/" \
30+
--mirror-binary-security "http://security.ubuntu.com/ubuntu/" \
31+
--parent-mirror-binary-security "http://security.ubuntu.com/ubuntu/" \
32+
--mirror-binary "http://archive.ubuntu.com/ubuntu/" \
33+
--parent-mirror-binary "http://archive.ubuntu.com/ubuntu/" \
34+
--keyring-packages ubuntu-keyring \
35+
--apt-options "--yes --option Acquire::Retries=5 --option Acquire::http::Timeout=100" \
36+
--uefi-secure-boot enable \
37+
--binary-images iso-hybrid \
1638
--iso-application "$NAME" \
1739
--iso-volume "$NAME" \
18-
--memtest none \
19-
--mode ubuntu \
20-
--parent-archive-areas "main restricted universe multiverse" \
21-
--source false \
22-
--syslinux-theme elementary-@SYSLINUX \
23-
--zsync false
40+
--firmware-binary false \
41+
--firmware-chroot false \
42+
--zsync false \
43+
"${@}"
2444

2545
# replace channel and suite
26-
sed -i "s/@CHANNEL/$CHANNEL/" config/archives/*.list
27-
sed -i "s/@BASECODENAME/$BASECODENAME/" config/archives/*.list
46+
sed -i "s/@CHANNEL/$CHANNEL/" config/archives/*.list*
47+
sed -i "s/@BASECODENAME/$BASECODENAME/" config/archives/*.list*
2848

29-
mkdir -p config/includes.chroot/boot/efi
30-
if [ "$ARCH" = "amd64" ]; then
31-
echo "fs0:\EFI\ubuntu\grubx64.efi" > config/includes.chroot/boot/efi/startup.nsh
32-
elif [ "$ARCH" = "i386" ]; then
33-
echo "fs0:\EFI\ubuntu\grubx32.efi" > config/includes.chroot/boot/efi/startup.nsh
34-
fi
49+
DATE=$(date +%Y%m%d)
50+
sed -i "s/@CHANNEL/$CHANNEL/" config/includes.binary/.disk/info
51+
sed -i "s/@CODENAME/$CODENAME/" config/includes.binary/.disk/info
52+
sed -i "s/@ARCH/$ARCH/" config/includes.binary/.disk/info
53+
sed -i "s/@DISTRO_NAME/$NAME/" config/includes.binary/.disk/info
54+
sed -i "s/@VERSION/$VERSION/" config/includes.binary/.disk/info
55+
sed -i "s/@DATE/$DATE/" config/includes.binary/.disk/info
56+
57+
sed -i "s/@XORG_HWE/$XORG_HWE/" config/package-lists/desktop.list.chroot_install

etc/config/archives/appcenter.key etc/config/archives/appcenter.key.binary

+1
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ tvaG0+WhBRe/aHu5wnKkfExLdsW8mDrNUnDykTj50Cki1kfFvLWlSLz6wlXyqG1U
2828
+F4YBpd9FIy7LBnLhfK0F4aBe7iTLPiYJ7TUpIez3k7ubRGGBZg=
2929
=ICrR
3030
-----END PGP PUBLIC KEY BLOCK-----
31+

etc/config/archives/appcenter.list

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deb http://packages.elementary.io/appcenter @BASECODENAME main
2+

etc/config/archives/elementary.key

100755100644
+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ AQIeAQIXgAAKCRC/NplsTh+KWdvoA/4kAGaOfHqUzuDbzl6eEmPeskbHXUC9jFlnw7SCx6TC
1010
XGgizlksadNiafQSS41B+/kGoGi93GPsXUn4lF/VCfyeHeBmzDVSZ/h37Q==
1111
=CwtG
1212
-----END PGP PUBLIC KEY BLOCK-----
13+

etc/config/archives/elementary.list

100755100644
+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
deb http://ppa.launchpad.net/elementary-os/@CHANNEL/ubuntu @BASECODENAME main
22
deb-src http://ppa.launchpad.net/elementary-os/@CHANNEL/ubuntu @BASECODENAME main
3+

etc/config/archives/patches.key

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ AQIeAQIXgAAKCRC/NplsTh+KWdvoA/4kAGaOfHqUzuDbzl6eEmPeskbHXUC9jFlnw7SCx6TC
1010
XGgizlksadNiafQSS41B+/kGoGi93GPsXUn4lF/VCfyeHeBmzDVSZ/h37Q==
1111
=CwtG
1212
-----END PGP PUBLIC KEY BLOCK-----
13+

etc/config/archives/patches.list

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
deb http://ppa.launchpad.net/elementary-os/os-patches/ubuntu @BASECODENAME main
22
deb-src http://ppa.launchpad.net/elementary-os/os-patches/ubuntu @BASECODENAME main
3+

etc/config/archives/patches.pref

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Explanation: OS patches for elementary OS.
2+
Explanation: We need this pin because our patched build can lag a few hours behind Ubuntu's updates,
3+
Explanation: and during those few hours packages can be overwritten with unpatched ones.
4+
Package: *
5+
Pin: release o=LP-PPA-elementary-os-os-patches
6+
Pin-Priority: 999
Binary file not shown.
Binary file not shown.
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
title-text: ""
2+
desktop-image: "background.png"
3+
desktop-color: "#000000"
4+
title-color: "#ffffff"
5+
title-font: "DejaVu Sans Bold 16"
6+
message-font: "Unifont Regular 16"
7+
8+
terminal-left: "0"
9+
terminal-top: "0"
10+
terminal-width: "100%"
11+
terminal-height: "100%"
12+
terminal-border: "0"
13+
14+
# Logo image
15+
+ image {
16+
left = 50%-50
17+
top = 50%-50
18+
file = "logo.png"
19+
}
20+
21+
#help bar at the bottom
22+
+ label {
23+
top = 100%-50
24+
left = 0
25+
width = 100%
26+
height = 20
27+
text = "@KEYMAP_SHORT@"
28+
align = "center"
29+
color = "#ffffff"
30+
font = "DejaVu Sans Bold 14"
31+
}
32+
33+
#boot menu
34+
+ boot_menu {
35+
left = 50%-150
36+
width = 500
37+
top = 50%+100
38+
height = 300
39+
40+
item_font = "DejaVu Sans Bold 14"
41+
item_color = "#999"
42+
selected_item_font = "DejaVu Sans Bold 14"
43+
selected_item_color= "#fff"
44+
45+
item_height = 26
46+
item_padding = 0
47+
item_icon_space = 0
48+
item_spacing = 1
49+
scrollbar = false
50+
}
51+
52+
# Show a countdown message using the label component
53+
+ label {
54+
top = 82%
55+
left = 35%
56+
width = 30%
57+
align = "center"
58+
id = "__timeout__"
59+
text = "Booting in %d seconds"
60+
color = "#f6f6f6"
61+
}
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
set default=0
2+
3+
set gfxmode=auto
4+
loadfont $prefix/dejavu-bold-16.pf2
5+
loadfont $prefix/dejavu-bold-14.pf2
6+
loadfont $prefix/unicode.pf2
7+
insmod all_video
8+
insmod gfxterm
9+
insmod png
10+
11+
set color_normal=light-gray/black
12+
set color_highlight=white/black
13+
14+
set theme=/boot/grub/elementary-theme/theme.txt
15+
16+
terminal_output gfxterm
17+
18+
set timeout=10
19+
set timeout_style=menu
20+
21+
menuentry "Try or install elementary OS" {
22+
linux /casper/vmlinuz APPEND_LIVE
23+
initrd /casper/initrd.lz
24+
}
25+
26+
submenu 'Advanced options...' {
27+
28+
# More installer entries (if any)
29+
LINUX_ADVANCED_INSTALL
30+
31+
# Memtest (if any)
32+
MEMTEST
33+
34+
}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/lib/syslinux/modules/bios/hdt.c32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/lib/ISOLINUX/isolinux.bin

0 commit comments

Comments
 (0)