forked from secureblue/secureblue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_secureblue_iso.sh
117 lines (105 loc) · 3.24 KB
/
generate_secureblue_iso.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
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env bash
if ! command -v podman &> /dev/null
then
echo "Podman is not installed, install it to use this script."
fi
function is_yes {
case $(echo "$1" | tr '[:upper:]' '[:lower:]') in
y|yes) return 0;;
*) return 1;;
esac
}
desktop_options=("kinoite" "cinnamon" "bluefin" "silverblue" "sericea" "wayblue-wayfire" "wayblue-sway" "wayblue-river" "wayblue-hyprland")
desktop_options_asus=("silverblue" "kinoite")
image_name=""
read -p "Do you need user namespaces? (yes/No): " use_userns
read -p "Do you use an Asus laptop? (yes/No): " is_asus
read -p "Do you use Nvidia? (yes/No): " use_nvidia
if is_yes "$is_asus"; then
echo "Select a desktop:"
select opt in "${desktop_options_asus[@]}"; do
case $opt in
"silverblue")
image_name+="silverblue"
break;
;;
"kinoite")
image_name+="kinoite"
break;
;;
*) echo "Invalid option";;
esac
done
image_name+="-asus"
if is_yes "$use_nvidia"; then
image_name+="-nvidia"
fi
else
read -p "Is this for a server? (yes/No): " is_server
if is_yes "$is_server"; then
image_name+="server"
else
echo "Select a desktop:"
select opt in "${desktop_options[@]}"; do
case $opt in
"silverblue")
image_name+="silverblue"
break;
;;
"kinoite")
image_name+="kinoite"
break;
;;
"cinnamon")
image_name+="cinnamon"
break;
;;
"sericea")
image_name+="sericea"
break;
;;
"bluefin")
image_name+="bluefin"
break;
;;
"wayblue-river")
image_name+="wayblue-river"
break;
;;
"wayblue-sway")
image_name+="wayblue-sway"
break;
;;
"wayblue-hyprland")
image_name+="wayblue-hyprland"
break;
;;
"wayblue-wayfire")
image_name+="wayblue-wayfire"
break;
;;
*) echo "Invalid option";;
esac
done
fi
if is_yes "$use_nvidia"; then
image_name+="-nvidia"
else
image_name+="-main"
fi
fi
if is_yes "$use_userns"; then
image_name+="-userns"
fi
image_name+="-hardened"
command="sudo podman run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest IMAGE_REPO=ghcr.io/secureblue IMAGE_NAME=$image_name VERSION=40 IMAGE_TAG=latest"
echo "Command to execute:"
echo "$command"
echo ""
read -p "Generate this ISO? (yes/No): " generate_iso
if is_yes "$generate_iso"; then
$command
mv deploy.iso $image_name.iso
mv deploy.iso-CHECKSUM $image_name.iso-CHECKSUM
sed -i "s/deploy.iso/$image_name.iso/" "$image_name.iso-CHECKSUM"
fi