Skip to content

Commit c3be117

Browse files
committed
Merge branch 'no-firewalld' into dev
2 parents 0426ad5 + 64e9227 commit c3be117

File tree

11 files changed

+124
-197
lines changed

11 files changed

+124
-197
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ keyring::
4646

4747
wizard:
4848
@sudo ${CURRENT_DIR}/tools/wizard.sh
49+
50+
check:
51+
@bash -c 'shopt -s globstar nullglob; shellcheck -s bash --exclude=SC2068 -S error **/*.{sh,ksh,bash}'
52+
@bash -c 'shopt -s globstar nullglob; shellcheck -s bash --exclude=SC2068 -S error tools/*.{sh,ksh,bash}'

channels/cinnamon/packages.i686/internet-gui.i686

Lines changed: 0 additions & 28 deletions
This file was deleted.

channels/gnome/packages.x86_64/internet-gui.x86_64

Lines changed: 0 additions & 28 deletions
This file was deleted.

channels/plasma/airootfs.any/root/customize_airootfs_plasma.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ if [[ "${arch}" = "x86_64" ]]; then
1717
systemctl enable apparmor.service
1818
systemctl enable snapd.socket
1919
systemctl enable snapd.service
20-
21-
22-
# firewalld
23-
systemctl enable firewalld.service
2420
fi
2521

2622

channels/plasma/packages.x86_64/internet.x86_64

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@ kdenetwork-filesharing
2727

2828

2929
#-- security --#
30-
firewalld
31-
ufw
30+
gufw

channels/xfce/packages.x86_64/internet-gui.x86_64

Lines changed: 0 additions & 28 deletions
This file was deleted.

modules/share-extra/airootfs.any/root/customize_airootfs_share-extra.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ _systemd_service enable snapd.apparmor.service
1616
_systemd_service enable apparmor.service
1717
_systemd_service enable snapd.socket
1818
_systemd_service enable snapd.service
19-
20-
21-
# firewalld
22-
_systemd_service enable firewalld.service
19+
_systemd_service enable ufw.service
2320

2421

2522
# Added autologin group to auto login

modules/share-extra/packages.i686/internet-gui.i686

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ firefox
2424

2525

2626
#-- security --#
27-
firewalld
28-
ufw
27+
gufw

modules/share-extra/packages.x86_64/internet-gui.x86_64

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ chromium
2424

2525

2626
#-- security --#
27-
firewalld
28-
ufw
27+
gufw

modules/share/airootfs.any/root/customize_airootfs.sh

Lines changed: 4 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
set -e -u
1111

1212

13-
# Default value
1413
# Default value
1514
# All values can be changed by arguments.
1615
password=alter
@@ -56,45 +55,15 @@ kernel_mkinitcpio_profile="${kernel_config_line[2]}"
5655
# Make it compatible with previous code
5756
unset OPTIND OPTARG arg
5857

58+
# Load functions
59+
source "/root/functions.sh"
5960

60-
# Check whether true or false is assigned to the variable.
61-
function check_bool() {
62-
local
63-
case $(eval echo '$'${1}) in
64-
true | false) : ;;
65-
*) echo "The value ${boot_splash} set is invalid" >&2 ;;
66-
esac
67-
}
6861

62+
# Check bool type
6963
check_bool boot_splash
7064
check_bool debug
7165

7266

73-
# Delete file only if file exists
74-
# remove <file1> <file2> ...
75-
function remove () {
76-
local _list
77-
local _file
78-
_list=($(echo "$@"))
79-
for _file in "${_list[@]}"; do
80-
if [[ -f ${_file} ]]; then
81-
rm -f "${_file}"
82-
elif [[ -d ${_file} ]]; then
83-
rm -rf "${_file}"
84-
fi
85-
echo "${_file} was deleted."
86-
done
87-
}
88-
89-
90-
function installedpkg () {
91-
if pacman -Qq "${1}" 1>/dev/null 2>/dev/null; then
92-
return 0
93-
else
94-
return 1
95-
fi
96-
}
97-
9867
# Enable and generate languages.
9968
sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen
10069
if [[ ! "${localegen}" = "en_US\\.UTF-8\\" ]]; then
@@ -113,21 +82,6 @@ if [[ -f "/etc/skel/Desktop/calamares.desktop" ]]; then
11382
fi
11483

11584

116-
# user_check <name>
117-
function user_check () {
118-
if [[ ! -v 1 ]]; then return 2; fi
119-
getent passwd "${1}" > /dev/null
120-
}
121-
122-
# Execute only if the command exists
123-
# run_additional_command [command name] [command to actually execute]
124-
run_additional_command() {
125-
if [[ -f "$(type -p "${1}" 2> /dev/null)" ]]; then
126-
shift 1
127-
eval "${@}"
128-
fi
129-
}
130-
13185
usermod -s "${usershell}" root
13286
cp -aT /etc/skel/ /root/
13387
if [[ -f "$(type -p "xdg-user-dirs-update" 2> /dev/null)" ]]; then LC_ALL=C LANG=Cxdg-user-dirs-update; fi
@@ -136,40 +90,8 @@ echo -e "${password}\n${password}" | passwd root
13690
# Allow sudo group to run sudo
13791
sed -i 's/^#\s*\(%sudo\s\+ALL=(ALL)\s\+ALL\)/\1/' /etc/sudoers
13892

139-
# Create a user.
140-
# create_user <username> <password>
141-
function create_user () {
142-
local _password
143-
local _username
144-
145-
_username=${1}
146-
_password=${2}
147-
148-
set +u
149-
if [[ -z "${_username}" ]]; then
150-
echo "User name is not specified." >&2
151-
return 1
152-
fi
153-
if [[ -z "${_password}" ]]; then
154-
echo "No password has been specified." >&2
155-
return 1
156-
fi
157-
set -u
158-
159-
if ! user_check "${_username}"; then
160-
useradd -m -s ${usershell} ${_username}
161-
groupadd sudo
162-
usermod -U -g ${_username} ${_username}
163-
usermod -aG sudo ${_username}
164-
usermod -aG storage ${_username}
165-
cp -aT /etc/skel/ /home/${_username}/
166-
fi
167-
chmod 700 -R /home/${_username}
168-
chown ${_username}:${_username} -R /home/${_username}
169-
echo -e "${_password}\n${_password}" | passwd ${_username}
170-
set -u
171-
}
17293

94+
# Create user
17395
create_user "${username}" "${password}"
17496

17597

@@ -281,23 +203,6 @@ sed -i -r "s/(GRUB_DISTRIBUTOR=).*/\1\"${grub_os_name}\"/g" "/etc/default/grub"
281203
run_additional_command "gtk-update-icon-cache -f /usr/share/icons/hicolor"
282204

283205

284-
# systemctl helper
285-
# Execute the subcommand only when the specified unit is available.
286-
# Usage: _systemd_service <systemctl subcommand> <service1> <service2> ...
287-
_systemd_service(){
288-
local _service
289-
local _command="${1}"
290-
shift 1
291-
for _service in "${@}"; do
292-
# https://unix.stackexchange.com/questions/539147/systemctl-check-if-a-unit-service-or-target-exists
293-
if (( "$(systemctl list-unit-files "${_service}" | wc -l)" > 3 )); then
294-
systemctl ${_command} "${_service}"
295-
else
296-
echo "${_service} was not found" >&2
297-
fi
298-
done
299-
}
300-
301206
# Enable graphical.
302207
_systemd_service set-default graphical.target
303208

0 commit comments

Comments
 (0)