-
Notifications
You must be signed in to change notification settings - Fork 35
/
mesalockiso
executable file
·63 lines (53 loc) · 1.54 KB
/
mesalockiso
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
#!/bin/bash
# Copyright (c) 2017, The MesaLock Linux Project Contributors
# All rights reserved.
#
# This work is licensed under the terms of the BSD 3-Clause License.
# For a copy, see the LICENSE file.
set -e
workdir="$(pwd)"
builddir="$(pwd)/build"
rootfsdir="$builddir/rootfs"
isodir="$builddir/iso"
rm -rf "$isodir" && mkdir -p "$isodir"
echo "[+] mesalockiso: installing bootloader and kernel"
packages=(linux syslinux)
for p in "${packages[@]}"; do
tar xfkJ build/"$p"-*/"$p"-*.tar.xz -C "$isodir"
done
echo "[+] mesalockiso: installing rootfs"
packages=(filesystem \
minit \
mgetty \
glibc \
gcc-libs \
ion-shell \
uutils-coreutils \
giproute2 \
mesalock-demo \
)
# ripgrep \
# fd-find \
# tzdata \
# xi-core \
# xi-term \
# uutils-findutils \
# tokei \
# brotli \
# micro)
rm -rf "$rootfsdir" && mkdir -p "$rootfsdir"
for p in "${packages[@]}"; do
tar xfkJ build/"$p"-*/"$p"-*.tar.xz -C "$rootfsdir"
done
echo "[+] mesalockiso: packaging initramfs"
mkdir -p "$isodir/boot"
cd "$rootfsdir"
find . | sort | fakeroot cpio --quiet -o -H newc | pigz -9 > "$isodir/boot/initramfs"
echo "[+] mesalockiso: generating iso"
cd "$builddir" && xorrisofs -o mesalock-linux.iso -l -J -R \
-b boot/syslinux/isolinux.bin \
-c boot/syslinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-quiet -follow-links iso \
> /dev/null
isohybrid mesalock-linux.iso > /dev/null