-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (93 loc) · 3.58 KB
/
ubuntu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build Ubuntu Live Image
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget syslinux-common pxelinux
sudo apt-get install -y build-essential fakeroot libncurses5-dev libssl-dev ccache bison flex libelf-dev libudev-dev libpci-dev libiberty-dev debhelper dpkg-dev debootstrap gpg ubuntu-keyring
wget https://ftp.debian.org/debian/pool/main/l/live-build/live-build_20240810_all.deb
sudo dpkg -i live-build_20240810_all.deb
- name: Configure live-build for Ubuntu Jammy
run: |
mkdir -p live-build
cd live-build
lb config \
--distribution jammy \
--debian-installer live \
--debian-installer-distribution jammy \
--archive-areas "main restricted universe multiverse" \
--security true \
--updates true \
--mirror-bootstrap "http://archive.ubuntu.com/ubuntu/" \
--mirror-binary "http://archive.ubuntu.com/ubuntu/" \
--mirror-binary-security "http://security.ubuntu.com/ubuntu/" \
--mirror-debian-installer "http://archive.ubuntu.com/ubuntu/" \
--parent-mirror-chroot-security "http://security.ubuntu.com/ubuntu/" \
--parent-mirror-binary-security "http://security.ubuntu.com/ubuntu/" \
--mirror-chroot-security "http://security.ubuntu.com/ubuntu/" \
--apt-recommends false
# Create necessary directories
mkdir -p config/packages.chroot config/package-lists config/hooks/normal config/includes.chroot/etc/default
# Create package list
cat << EOF > config/package-lists/my.list.chroot
linux-generic
grub-pc
EOF
# Create GRUB default configuration
echo 'GRUB_TIMEOUT=5' > config/includes.chroot/etc/default/grub
# Create a hook to update initramfs and install grub-pc
cat << EOF > config/hooks/normal/0100-update-initramfs.hook.chroot
#!/bin/sh
set -e
# Ensure /dev, /proc, and /sys are mounted
mount -t devtmpfs devtmpfs /dev || true
mount -t proc proc /proc || true
mount -t sysfs sysfs /sys || true
# Update and install packages
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y linux-generic grub-pc
# Update initramfs for all installed kernels
update-initramfs -u -k all
# Update GRUB configuration
update-grub
# Unmount the filesystems
umount /sys || true
umount /proc || true
umount /dev || true
EOF
chmod +x config/hooks/normal/0100-update-initramfs.hook.chroot
- name: Build Ubuntu Live ISO
run: |
cd live-build
sudo lb clean
sudo lb config
sudo lb build
continue-on-error: true
- name: Check for ISO file
run: |
if [ -f live-build/live-image-amd64.hybrid.iso ]; then
echo "ISO file created successfully"
else
echo "Error: ISO file not created"
ls -R live-build
exit 1
fi
- name: Upload Live ISO
if: success()
uses: actions/upload-artifact@v4
with:
name: ubuntu-noble-live.iso
path: live-build/live-image-amd64.hybrid.iso
- name: Clean up
if: always()
run: |
cd live-build
sudo lb clean
sudo rm -rf chroot