This repository has been archived by the owner on Mar 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-entrypoint.sh
executable file
·104 lines (97 loc) · 3.16 KB
/
docker-entrypoint.sh
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
#!/bin/bash
##############################################################################
# This script functions as the build command, allowing me to run the build command through docker without needing to interact with the build process``
cr="$(tput setaf 1)"
cg="$(tput setaf 2)"
cy="$(tput setaf 3)"
cm="$(tput setaf 5)"
sb="$(tput bold)"
sn="$(tput sgr0)"
print() {
case "$1" in
t | title)
shift
printf "%s\n" "${sb}${cg}[###]$*${sn}"
;;
s | step)
shift
printf "%s\n" "${sb}${cm}[===]$*${sn}"
;;
e | error)
shift
printf "%s\n" "${sb}${cr}[!!!]$*${sn}"
exit 1
;;
w | warning)
shift
printf "%s\n" "${sb}${cy}[:::]$*${sn}"
;;
*)
printf '%s\n' "$*"
;;
esac
}
##############################################################################
##############################################################################
##############################################################################
function deleteTMPFS() {
# sudo pacman -Scc
if [ -d "/tmp/mkarchiso" ]; then
print s "##############################################"
print s "Deleting TMPFS directory from the last build"
print s "##############################################"
sudo rm -rvf /tmp/mkarchiso*
print s "Deletion Completion"
fi
print s "##############################################"
print s "Ensure loopback dev nodes are created"
print s "##############################################"
mknod -m 0660 /dev/loop0 b 0 8
losetup -f
print s "##############################################"
print s "Ensure iso directory is writable"
print s "##############################################"
chmod 755 /iso
echo
echo
}
##############################################################################
##############################################################################
##############################################################################
function mkarchiso {
print s "##############################################"
print s "Running the ISO Build Command"
print s "##############################################"
bash -c "sudo mkarchiso -v -w /tmp/mkarchiso-el /build/releng "
print w "##############################################"
print w "ISO Built"
print w "##############################################"
mv out/* /iso
chmod 777 /iso/*.iso
echo
echo
}
print t "##############################################"
print t "mkarchiso Build Script Within Docker"
print t "##############################################"
echo
echo
sleep 3s
echo
echo
print s "##############################################"
print s "Phase 1:Environment Setup"
print s "##############################################"
echo
echo
deleteTMPFS
print s "##############################################"
print s "Phase 2: Build"
print s "##############################################"
echo
echo
mkarchiso
print w "##############################################"
print w "End Docker Entrypoint Script, Good Luck!"
print w "##############################################"
exit