Skip to content

Commit

Permalink
[update] : Integrated script
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 authored and mineyoshikawasnow committed Jan 28, 2021
1 parent a881c69 commit b85719f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 55 deletions.
32 changes: 17 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,24 +359,26 @@ make_config() {
# -x : Enable bash debug mode.
# -z <locale_time> : Set the time zone.

local _airootfs_script_options _run_script
_airootfs_script_options="-p ${liveuser_password} -u ${liveuser_name} -o ${os_name} -s ${liveuser_shell} -a ${arch} -g ${locale_gen_name} -l ${locale_name} -z ${locale_time} "
local _main_script="root/customize_airootfs.sh" _script_list=("${work_dir}/airootfs/root/customize_airootfs_${channel_name}.sh") _file_fullpath="${work_dir}/airootfs/${_main_script}"
local _airootfs_script_options="-p ${liveuser_password} -u ${liveuser_name} -o ${os_name} -s ${liveuser_shell} -a ${arch} -g ${locale_gen_name} -l ${locale_name} -z ${locale_time}"
if [[ ${bootsplash} == true ]]; then
_airootfs_script_options="${_airootfs_script_options} -b"
_airootfs_script_options+=" -b"
fi
_run_script() {
local _file _file_fullpath
for _file in ${@}; do
_file_fullpath="${work_dir}/airootfs${_file}"
if [[ -f "${_file_fullpath}" ]]; then
chmod 755 "${_file_fullpath}"
run_cmd "${_file}" ${_airootfs_script_options}
remove "${_file_fullpath}"
fi
done
}

_run_script "/root/customize_airootfs.sh" "/root/customize_airootfs_${channel_name}.sh"
# Create script
for _script in ${_script_list[@]}; do
if [[ -f "${_script}" ]]; then
echo -e "\n" >> "${_file_fullpath}"
cat "${_script}" >> "${_file_fullpath}"
remove "${_script}"
fi
done

if [[ -f "${_file_fullpath}" ]]; then
chmod 755 "${_file_fullpath}"
run_cmd "${_file}" ${_airootfs_script_options}
remove "${_file_fullpath}"
fi
}

make_clean() {
Expand Down
21 changes: 1 addition & 20 deletions channels/lxde/airootfs/root/customize_airootfs_lxde.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
#!/usr/bin/env bash

while getopts 'p:bt:k:rxu:o:i:s:da:g:z:l:' arg; do
case "${arg}" in
p) password="${OPTARG}" ;;
b) boot_splash=true ;;
t) theme_name="${OPTARG}" ;;
k) kernel_config_line=(${OPTARG}) ;;
r) rebuild=true ;;
u) username="${OPTARG}" ;;
o) os_name="${OPTARG}" ;;
i) install_dir="${OPTARG}" ;;
s) usershell="${OPTARG}" ;;
d) debug=true ;;
x) debug=true; set -xv ;;
a) arch="${OPTARG}" ;;
g) localegen="${OPTARG}" ;;
z) timezone="${OPTARG}" ;;
l) language="${OPTARG}" ;;
esac
done
systemctl disable lxdm.service
dnf remove -y lxdm
dnf install -y lightdm lightdm-gtk
Expand All @@ -45,4 +26,4 @@ sed -i "s/fedora/Serene Linux on Fedora/g" /usr/share/calamares/modules/bootload
sed -i "s/auto/serene/g" /usr/share/calamares/settings.conf
if [[ $boot_splash = true ]]; then
/usr/sbin/plymouth-set-default-theme serene-logo
fi
fi
21 changes: 1 addition & 20 deletions channels/serene/airootfs/root/customize_airootfs_serene.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
#!/usr/bin/env bash

while getopts 'p:bt:k:rxu:o:i:s:da:g:z:l:' arg; do
case "${arg}" in
p) password="${OPTARG}" ;;
b) boot_splash=true ;;
t) theme_name="${OPTARG}" ;;
k) kernel_config_line=(${OPTARG}) ;;
r) rebuild=true ;;
u) username="${OPTARG}" ;;
o) os_name="${OPTARG}" ;;
i) install_dir="${OPTARG}" ;;
s) usershell="${OPTARG}" ;;
d) debug=true ;;
x) debug=true; set -xv ;;
a) arch="${OPTARG}" ;;
g) localegen="${OPTARG}" ;;
z) timezone="${OPTARG}" ;;
l) language="${OPTARG}" ;;
esac
done
systemctl enable lightdm.service
sed -i s/%USERNAME%/${username}/g /etc/lightdm/lightdm.conf
dconf update
Expand Down Expand Up @@ -49,4 +30,4 @@ fi
if [[ ${localegen} == "en_US.UTF-8" ]]; then
rm -rf /opt/flast-gecko-nightly/locale.ini
fi
chmod 755 /usr/bin/serenelinux-gtk-bookmarks
chmod 755 /usr/bin/serenelinux-gtk-bookmarks

0 comments on commit b85719f

Please sign in to comment.