--- /dev/null
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=Install %OS_NAME%
+GenericName=%OS_NAME% Installer
+Keywords=calamares;serene;linux;installer;
+TryExec=calamares
+Exec=sudo /usr/bin/calamares
+Comment=%OS_NAME% Installer - by Calamares
+Icon=/usr/share/icons/hicolor/scalable/apps/calamares.svg
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Qt;System;
+X-AppStream-Ignore=true
+
+Name[ar]=تثبيت النظام
+GenericName[ar]=مثبت النظام
+Comment[ar]=كالامارس - مثبت النظام
+Name[as]=চিছটেম ইনস্তল কৰক
+GenericName[as]=চিছটেম ইনস্তলাৰ
+Comment[as]=কেলামাৰেচ — চিছটেম ইনস্তলাৰ
+Name[be]=Усталяваць сістэму
+GenericName[be]=Усталёўшчык сістэмы
+Comment[be]=Calamares — усталёўшчык сістэмы
+Name[bg]=Инсталирай системата
+GenericName[bg]=Системен Инсталатор
+Comment[bg]=Calamares — Системен Инсталатор
+Name[ca]=Instal·la el sistema
+GenericName[ca]=Instal·lador de sistema
+Comment[ca]=Calamares — Instal·lador de sistema
+Name[da]=Installér %OS_NAME%
+GenericName[da]=%OS_NAME%installationsprogram
+Comment[da]=Calamares — %OS_NAME%installationsprogram
+Name[de]=%OS_NAME% installieren
+GenericName[de]=Installation des Betriebs%OS_NAME%s
+Comment[de]=Calamares - Installation des Betriebs%OS_NAME%s
+Name[el]=Εγκατάσταση συστήματος
+GenericName[el]=Εγκατάσταση συστήματος
+Comment[el]=Calamares — Εγκατάσταση συστήματος
+Name[en_GB]=Install %OS_NAME%
+GenericName[en_GB]=%OS_NAME% Installer
+Comment[en_GB]=Calamares — %OS_NAME% Installer
+Name[es]=Instalar Sistema
+GenericName[es]=Instalador del Sistema
+Comment[es]=Calamares — Instalador del Sistema
+Name[et]=Paigalda süsteem
+GenericName[et]=Süsteemipaigaldaja
+Comment[et]=Calamares — süsteemipaigaldaja
+Name[eu]=Sistema instalatu
+GenericName[eu]=Sistema instalatzailea
+Comment[eu]=Calamares - sistema instalatzailea
+Name[es_PR]=Instalar el sistema
+Name[fr]=Installer le système
+GenericName[fr]=Installateur système
+Comment[fr]=Calamares - Installateur système
+Name[gl]=Instalación do Sistema
+GenericName[gl]=Instalador de sistemas
+Comment[gl]=Calamares — Instalador de sistemas
+Name[he]=התקנת מערכת
+GenericName[he]=אשף התקנה
+Comment[he]=Calamares - אשף התקנה
+Name[hi]=सिस्टम इंस्टॉल करें
+GenericName[hi]=सिस्टम इंस्टॉलर
+Comment[hi]=Calamares — सिस्टम इंस्टॉलर
+Name[hr]=Instaliraj sustav
+GenericName[hr]=Instalacija sustava
+Comment[hr]=Calamares — Instalacija sustava
+Name[hu]=Rendszer telepítése
+GenericName[hu]=Rendszertelepítő
+Comment[hu]=Calamares – Rendszertelepítő
+Name[id]=Instal Sistem
+GenericName[id]=Pemasang
+Comment[id]=Calamares — Pemasang Sistem
+Name[is]=Setja upp kerfið
+GenericName[is]=Kerfis uppsetning
+Comment[is]=Calamares — Kerfis uppsetning
+Name[cs_CZ]=Nainstalovat systém
+GenericName[cs_CZ]=Instalátor systému
+Comment[cs_CZ]=Calamares – instalátor operačních systémů
+Name[ja]=%OS_NAME%をインストール
+GenericName[ja]=%OS_NAME%インストーラー
+Comment[ja]=Calamares — %OS_NAME%インストーラー
+Name[ko]=시스템 설치
+GenericName[ko]=시스템 설치 관리자
+Comment[ko]=깔라마레스 — 시스템 설치 관리자
+Name[lt]=Įdiegti Sistemą
+GenericName[lt]=Sistemos diegimas į kompiuterį
+Comment[lt]=Calamares — Sistemos diegimo programa
+Name[it_IT]=Installa il sistema
+GenericName[it_IT]=Programma d'installazione del sistema
+Comment[it_IT]=Calamares — Programma d'installazione del sistema
+Name[mk]=Инсталирај го системот
+GenericName[mk]=Системен Инсталер
+Comment[mk]=Calamares - Системен Инсталер
+Name[ml]=സിസ്റ്റം ഇൻസ്റ്റാൾ ചെയ്യുക
+GenericName[ml]=സിസ്റ്റം ഇൻസ്റ്റാളർ
+Comment[ml]=കലാമാരേസ് - സിസ്റ്റം ഇൻസ്റ്റാളർ
+Name[nb]=Installer %OS_NAME%
+GenericName[nb]=%OS_NAME%installatør
+Comment[nb]=Calamares-%OS_NAME%installatør
+Name[nl]=Installeer systeem
+GenericName[nl]=Installatieprogramma
+Comment[nl]=Calamares — Installatieprogramma
+Name[pl]=Zainstaluj %OS_NAME%
+GenericName[pl]=Instalator %OS_NAME%
+Comment[pl]=Calamares — Instalator %OS_NAME%
+Name[pt_BR]=Sistema de Instalação
+GenericName[pt_BR]=Instalador de Sistema
+Comment[pt_BR]=Calamares — Instalador de Sistema
+Name[ro]=Instalează sistemul
+GenericName[ro]=Instalator de sistem
+Comment[ro]=Calamares — Instalator de sistem
+Name[ru]=Установить систему
+GenericName[ru]=Установщик системы
+Comment[ru]=Calamares - Установщик системы
+Name[sk]=Inštalovať systém
+GenericName[sk]=Inštalátor systému
+Comment[sk]=Calamares — Inštalátor systému
+Name[sl]=Namesti sistem
+Name[sq]=Instalo Sistemin
+GenericName[sq]=Instalues Sistemi
+Comment[sq]=Calamares — Instalues Sistemi
+Name[fi_FI]=Asenna Järjestelmä
+GenericName[fi_FI]=Järjestelmän Asennusohjelma
+Comment[fi_FI]=Calamares — Järjestelmän Asentaja
+Name[sr@latin]=Instaliraj sistem
+Name[sr]=Инсталирај систем
+GenericName[sr]=Инсталатер система
+Comment[sr]=Каламарес — инсталатер система
+Name[sv]=Installera %OS_NAME%
+GenericName[sv]=%OS_NAME%installerare
+Comment[sv]=Calamares — %OS_NAME%installerare
+Name[th]=ติดตั้งระบบ
+Name[uk]=Встановити Систему
+GenericName[uk]=Встановлювач системи
+Comment[uk]=Calamares - Встановлювач системи
+Name[zh_CN]=安装系统
+GenericName[zh_CN]=系统安装程序
+Comment[zh_CN]=Calamares — 系统安装程序
+Name[zh_TW]=安裝系統
+GenericName[zh_TW]=系統安裝程式
+Comment[zh_TW]=Calamares ── 系統安裝程式
+Name[ast]=Instalar el sistema
+GenericName[ast]=Instalador del sistema
+Comment[ast]=Calamares — Instalador del sistema
+Name[eo]=Instali Sistemo
+GenericName[eo]=Sistema Instalilo
+Comment[eo]=Calamares — Sistema Instalilo
+Name[ne_NP]=सिस्टम इन्स्टल गर्नुहोस्
+GenericName[ne_NP]=सिस्टम इन्स्टलर
+Comment[ne_NP]=Calamares - सिस्टम इन्स्टलर
+Name[es_MX]=Instalar el Sistema
+GenericName[es_MX]=Instalador del sistema
+Comment[es_MX]=Calamares - Instalador del sistema
+Name[pt_PT]=Instalar Sistema
+GenericName[pt_PT]=Instalador de Sistema
+Comment[pt_PT]=Calamares - Instalador de Sistema
+Name[tr_TR]=Sistemi Yükle
+GenericName[tr_TR]=Sistem Yükleyici
+Comment[tr_TR]=Calamares — Sistem Yükleyici
systemctl enable lightdm.service
sed -i s/%USERNAME%/${username}/g /etc/lightdm/lightdm.conf
dconf update
+# Set os name
+sed -i s/%OS_NAME%/"${os_name}"/g /etc/skel/Desktop/calamares.desktop
+cp -f /etc/skel/Desktop/calamares.desktop /home/${username}/Desktop/calamares.desktop
+# delete xscreen
+dnf remove -y xscreensaver-base
+# delete dnfdragora
+dnf remove -y dnfdragora
+# Create Calamares Entry
+cp -f /etc/skel/Desktop/calamares.desktop /usr/share/applications/calamares.desktop
+
+unlink /usr/share/backgrounds/images/default.png
+ln -s /usr/share/backgrounds/serene-wallpaper-1.png /usr/share/backgrounds/images/default.png
+
+echo -e "sed -i \"s/^autologin/#autologin/g\" /etc/lightdm/lightdm.conf" >> /usr/share/calamares/final-process
+sed -i "s/- packages/- shellprocess\n - removeuser\n - packages/g" /usr/share/calamares/settings.conf
+sed -i "s/sb-shim/grub/g" /usr/share/calamares/modules/bootloader.conf
+sed -i "s/fedora/Serene Linux on Fedora/g" /usr/share/calamares/modules/bootloader.conf
+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
\ No newline at end of file
--- /dev/null
+# Application
+gimp
\ No newline at end of file
--- /dev/null
+# backgrounds
+serenelinux-wallpaper
+@xfce-desktop-environment
+xfce4-whiskermenu-plugin
+serene-google-menus
+serenelinux-icon
powerline-fonts
zsh-autosuggestions
zsh-syntax-highlighting
-neofetch
+neofetch
--- /dev/null
+# installer
+calamares
langpacks-ja
-ibus-mozc
+ibus-mozc
--- /dev/null
+# saver
+light-locker
--- /dev/null
+# themes
+adapta-gtk-theme
+papirus-icon-theme
+@lxde-desktop
powerline-fonts
zsh-autosuggestions
zsh-syntax-highlighting
-neofetch
-# themes
-adapta-gtk-theme
-papirus-icon-theme
-@lxde-desktop
\ No newline at end of file
+neofetch
+++ /dev/null
-# base
-powerline-go
-powerline-fonts
-zsh-autosuggestions
-zsh-syntax-highlighting
-neofetch
-# themes
-paper-icon-theme
-numix-blue-gtk-theme-bin
-qt5ct
-qt5-qtstyleplugins
-# backgrounds
-serenelinux-wallpaper
-@xfce-desktop-environment
-xfce4-whiskermenu-plugin
-serene-google-menus
-serenelinux-icon
-# installer
-calamares
-# Application
-gimp
-chromium
-# package gui
-gnome-software
-# saver
-light-locker
--- /dev/null
+# Application
+gimp
+chromium
--- /dev/null
+# backgrounds
+serenelinux-wallpaper
+@xfce-desktop-environment
+xfce4-whiskermenu-plugin
+serene-google-menus
+serenelinux-icon
--- /dev/null
+# base
+powerline-go
+powerline-fonts
+zsh-autosuggestions
+zsh-syntax-highlighting
+neofetch
--- /dev/null
+# installer
+calamares
+# japanese
langpacks-ja
ibus-mozc
--- /dev/null
+# package gui
+gnome-software
--- /dev/null
+# saver
+light-locker
--- /dev/null
+# themes
+paper-icon-theme
+numix-blue-gtk-theme-bin
+qt5ct
+qt5-qtstyleplugins
+++ /dev/null
-# base
-kernel
-squashfs-tools
-dump
-isomd5sum
-dracut-live
-zsh
-NetworkManager-wifi
grub2-efi-x64-modules
sqlite
universal-hooks-os-release
-#ottosei
--- /dev/null
+# egg
+ottosei
plymouth
serene-plymouth-theme
plymouth-scripts
-plymouth-plugin-script
\ No newline at end of file
+plymouth-plugin-script
fi
run_cmd ln -sf /etc/machine-id /var/lib/dbus/machine-id
}
-make_repo_packages() {
- remove "${work_dir}/airootfs/dnfrepopkglist"
- #_apt_install initramfs-tools
- # run_cmd env -i bash -c 'DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade --yes'
-
- if [[ -f "${channels_dir}/share/add_repo.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/share/add_repo.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfrepopkglist"
- fi
-
- if [[ -f "${channels_dir}/${channel_name}/add_repo.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/${channel_name}/add_repo.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfrepopkglist"
- fi
-
- if [[ -s "${work_dir}/airootfs/dnfrepopkglist" ]]; then
- mount --bind "${cache_dir}" "${work_dir}/airootfs/dnf_cache"
- sed -i -e "s|\${codename}|${codename}|g" "${work_dir}/airootfs/dnfrepopkglist"
- run_cmd env -i bash -c 'dnf -y --nogpgcheck -c /dnf_conf install $(echo $(<dnfrepopkglist))'
- fi
-
- remove "${work_dir}/airootfs/dnfrepopkglist"
+make_repo_packages() {
+ local _pkg _pkglist=($("${script_path}/tools/pkglist.sh" -a "x86_64" -c "${channels_dir}/${channel_name}" -k "${codename}" -l "${locale_name}" $(if [[ "${boot_splash}" = true ]]; then echo -n "-b"; fi) ))
+ # Create a list of packages to be finally installed as packages.list directly under the working directory.
+ echo -e "# The list of packages that is installed in live cd.\n#\n\n" > "${work_dir}/packages.list"
+ # Install packages on airootfs
+ mount --bind "${cache_dir}" "${work_dir}/airootfs/dnf_cache"
+ run_cmd dnf -y --nogpgcheck -c /dnf_conf install "${_pkglist[*]}"
}
make_dnf_packages() {
- remove "${work_dir}/airootfs/dnfpkglist"
- #_apt_install initramfs-tools
- # run_cmd env -i bash -c 'DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade --yes'
-
- if [[ -f "${channels_dir}/share/packages.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/share/packages.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfpkglist"
- fi
- if [[ -f "${channels_dir}/share/packages-${locale_name}.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/share/packages-${locale_name}.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfpkglist"
- fi
-
- if [[ -f "${channels_dir}/${channel_name}/packages.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/${channel_name}/packages.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfpkglist"
- fi
-
- if [[ -f "${channels_dir}/${channel_name}/packages-${locale_name}.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/${channel_name}/packages-${locale_name}.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfpkglist"
- fi
- if [[ ${bootsplash} == true ]]; then
- if [[ -f "${channels_dir}/share/packages_plymouth.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/share/packages_plymouth.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfpkglist"
- fi
-
- if [[ -f "${channels_dir}/${channel_name}/packages_plymouth.${arch}" ]]; then
- grep -h -v ^'#' "${channels_dir}/${channel_name}/packages_plymouth.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/dnfpkglist"
- fi
- fi
- if [[ -s "${work_dir}/airootfs/dnfpkglist" ]]; then
- mount --bind "${cache_dir}" "${work_dir}/airootfs/dnf_cache"
- run_cmd env -i bash -c 'dnf -y --nogpgcheck -c /dnf_conf install $(echo $(<dnfpkglist))'
- fi
+
+ #local _pkg _pkglist=($("${script_path}/tools/pkglist.sh" -a "x86_64" -k "${kernel}" -c "${channel_dir}" -l "${locale_name}" $(if [[ "${boot_splash}" = true ]]; then echo -n "-b"; fi) ))
+ local _pkg _pkglist=($("${script_path}/tools/pkglist.sh" -a "x86_64" -c "${channels_dir}/${channel_name}" -l "${locale_name}" $(if [[ "${boot_splash}" = true ]]; then echo -n "-b"; fi) ))
+ # Create a list of packages to be finally installed as packages.list directly under the working directory.
+ echo -e "# The list of packages that is installed in live cd.\n#\n\n" > "${work_dir}/packages.list"
+ for _pkg in ${_pkglist[@]}; do
+ echo ${_pkg} >> "${work_dir}/packages.list"
+ done
- remove "${work_dir}/airootfs/dnfpkglist"
+ # Install packages on airootfs
+ mount --bind "${cache_dir}" "${work_dir}/airootfs/dnf_cache"
+ run_cmd dnf -y --nogpgcheck -c /dnf_conf install "${_pkglist[*]}"
}
make_cp_airootfs() {
--- /dev/null
+#!/usr/bin/env bash
+
+set -e
+
+script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && cd .. && pwd )"
+
+appname="msg.sh"
+bash_debug=false
+nocolor=false
+echo_opts=""
+message=""
+msg_type="info"
+msg_label=""
+label_space="7"
+adjust_chr=" "
+customized_label=false
+customized_label_color=false
+nolabel=false
+noappname=false
+noadjust=false
+output="stdout"
+
+_help() {
+ echo "usage ${0} [option] [type] [message]"
+ echo
+ echo "Display a message with a colored app name and message type label"
+ echo
+ echo " General type:"
+ echo " info General message"
+ echo " warn Warning message"
+ echo " error Error message"
+ echo " debug Debug message"
+ echo
+ echo " General options:"
+ echo " -a [name] Specify the app name"
+ echo " -c [character] Specify the character to adjust the label"
+ echo " -l [label] Specify the label."
+ echo " -n | --nocolor No output colored output"
+ echo " -o [option] Specify echo options"
+ echo " -r [color] Specify the color of label"
+ echo " -s [number] Specifies the label space."
+ echo " -x | --bash-debug Enables output bash debugging"
+ echo " -h | --help This help message"
+ echo
+ echo " --nolabel Do not output label"
+ echo " --noappname Do not output app name"
+ echo " --noadjust Do not adjust the width of the label"
+}
+
+# Message functions
+msg_error() {
+ "${script_path}/tools/msg.sh" -a "msg.sh" error "${1}"
+}
+
+
+while getopts "a:c:l:no:r:s:xh-:" arg; do
+ case ${arg} in
+ a) appname="${OPTARG}" ;;
+ c) adjust_chr="${OPTARG}" ;;
+ l)
+ customized_label=true
+ msg_label="${OPTARG}"
+ ;;
+ n) nocolor=true ;;
+ o) echo_opts="${OPTARG}" ;;
+ r)
+ customized_label_color=true
+ case ${OPTARG} in
+ "black")
+ labelcolor="30"
+ ;;
+ "red")
+ labelcolor="31"
+ ;;
+ "green")
+ labelcolor="32"
+ ;;
+ "yellow")
+ labelcolor="33"
+ ;;
+ "blue")
+ labelcolor="34"
+ ;;
+ "magenta")
+ labelcolor="35"
+ ;;
+ "cyan")
+ labelcolor="36"
+ ;;
+ "white")
+ labelcolor="37"
+ ;;
+ *)
+ msg_error "The wrong color."
+ exit 1
+ ;;
+ esac
+ ;;
+ s) label_space="${OPTARG}" ;;
+ x)
+ bash_debug=true
+ set -xv
+ ;;
+ h)
+ _help
+ shift 1
+ exit 0
+ ;;
+ -)
+ case "${OPTARG}" in
+ "nocolor") nocolor=true ;;
+ "bash-debug")
+ bash_debug=true
+ set -xv
+ ;;
+ "help")
+ _help
+ exit 0
+ ;;
+ "nolabel") nolabel=true ;;
+ "noappname") noappname=true ;;
+ "noadjust") noadjust=true ;;
+ *)
+ _help
+ exit 1
+ ;;
+ esac
+ esac
+done
+
+shift $((OPTIND - 1))
+
+# Color echo
+#
+# Text Color
+# 30 => Black
+# 31 => Red
+# 32 => Green
+# 33 => Yellow
+# 34 => Blue
+# 35 => Magenta
+# 36 => Cyan
+# 37 => White
+#
+# Background color
+# 40 => Black
+# 41 => Red
+# 42 => Green
+# 43 => Yellow
+# 44 => Blue
+# 45 => Magenta
+# 46 => Cyan
+# 47 => White
+#
+# Text decoration
+# You can specify multiple decorations with ;.
+# 0 => All attributs off (ノーマル)
+# 1 => Bold on (太字)
+# 4 => Underscore (下線)
+# 5 => Blink on (点滅)
+# 7 => Reverse video on (色反転)
+# 8 => Concealed on
+
+case ${1} in
+ "info")
+ msg_type="type"
+ output="stdout"
+ [[ "${customized_label_color}" = false ]] && labelcolor="32"
+ [[ "${customized_label}" = false ]] && msg_label="Info"
+ shift 1
+ ;;
+ "warn")
+ msg_type="warn"
+ output="stdout"
+ [[ "${customized_label_color}" = false ]] && labelcolor="33"
+ [[ "${customized_label}" = false ]] && msg_label="Warning"
+ shift 1
+ ;;
+ "debug")
+ msg_type="debug"
+ output="stdout"
+ [[ "${customized_label_color}" = false ]] && labelcolor="35"
+ [[ "${customized_label}" = false ]] && msg_label="Debug"
+ shift 1
+ ;;
+ "error")
+ msg_type="error"
+ output="stderr"
+ [[ "${customized_label_color}" = false ]] && labelcolor="31"
+ [[ "${customized_label}" = false ]] && msg_label="Error"
+ shift 1
+ ;;
+ "")
+ msg_error "Please specify the message type"
+ exit 1
+ ;;
+ *)
+ msg_error "Unknown message type"
+ exit 1
+ ;;
+esac
+
+word_count="${#msg_label}"
+message="${@}"
+
+echo_type() {
+ if [[ "${nolabel}" = false ]]; then
+ if [[ "${noadjust}" = false ]]; then
+ for i in $( seq 1 $(( ${label_space} - ${word_count})) ); do
+ echo -ne "${adjust_chr}"
+ done
+ fi
+ if [[ "${nocolor}" = false ]]; then
+ echo -ne "\e[$([[ -v backcolor ]] && echo -n "${backcolor}"; [[ -v labelcolor ]] && echo -n ";${labelcolor}"; [[ -v decotypes ]] && echo -n ";${decotypes}")m${msg_label}\e[m "
+ else
+ echo -ne "${msg_label} "
+ fi
+ fi
+}
+
+echo_appname() {
+ if [[ "${noappname}" = false ]]; then
+ if [[ "${nocolor}" = false ]]; then
+ echo -ne "\e[36m[${appname}]\e[m "
+ else
+ echo -ne "[${appname}] "
+ fi
+ fi
+}
+
+
+for count in $(seq "1" "$(echo -ne "${message}\n" | wc -l)"); do
+ echo_message=$(echo -ne "${message}\n" |head -n "${count}" | tail -n 1 )
+ full_message="$(echo_appname)$(echo_type)${echo_message}"
+ case "${output}" in
+ "stdout")
+ echo ${echo_opts} "${full_message}" >&1
+ ;;
+ "stderr")
+ echo ${echo_opts} "${full_message}" >&2
+ ;;
+ *)
+ echo ${echo_opts} "${full_message}" > ${output}
+ ;;
+ esac
+done
--- /dev/null
+#!/usr/bin/env bash
+
+set -e
+
+script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && cd .. && pwd )"
+share_dir="${script_path}/channels/share"
+
+boot_splash=false
+pkgdir_name="packages-repo"
+
+arch=""
+channel_dir=""
+codename=33
+locale_name=""
+
+#arch="x86_64"
+#channel_dir="${script_path}/channels/xfce"
+#kernel="zen"
+#locale_name="en"
+
+_help() {
+ echo "usage ${0} [options] [command]"
+ echo
+ echo "Get a list of packages to install on that channel"
+ echo
+ echo " General options:"
+ echo " -a | --arch [arch] Specify the architecture"
+ echo " -b | --boot-splash Enable boot splash"
+ echo " -c | --channel Specify the channel directory"
+ echo " -k | --kernel Specify the kernel"
+ echo " -h | --help This help message"
+}
+
+# Usage: getclm <number>
+# 標準入力から値を受けとり、引数で指定された列を抽出します。
+getclm() {
+ echo "$(cat -)" | cut -d " " -f "${1}"
+}
+
+# Message functions
+msg_error() {
+ "${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Error" -r "red" error "${1}"
+}
+
+msg_info() {
+ "${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Info" -r "green" error "${1}"
+}
+
+msg_debug() {
+ "${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Debug" -r "magenta" error "${1}"
+}
+
+
+# Parse options
+ARGUMENT="${@}"
+_opt_short="a:bc:k:l:h"
+_opt_long="arch:,boot-splash,channel:,codename:,locale:,help"
+OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- ${ARGUMENT})
+[[ ${?} != 0 ]] && exit 1
+
+eval set -- "${OPT}"
+unset OPT _opt_short _opt_long
+
+while true; do
+ case ${1} in
+ -a | --arch)
+ arch="${2}"
+ shift 2
+ ;;
+ -b | --boot-splash)
+ boot_splash=true
+ shift 1
+ ;;
+ -c | --channel)
+ channel_dir="${2}"
+ shift 2
+ ;;
+ -k | --codename)
+ codename="${2}"
+ shift 2
+ ;;
+ -l | --locale)
+ locale_name="${2}"
+ shift 2
+ ;;
+ -h | --help)
+ _help
+ exit 0
+ ;;
+ --)
+ shift 1
+ break
+ ;;
+
+ esac
+done
+
+
+if [[ -z "${arch}" ]]; then
+ msg_error "Architecture not specified"
+ exit 1
+elif [[ -z "${channel_dir}" ]]; then
+ msg_error "Channel directory not specified"
+ exit 1
+elif [[ -z "${codename}" ]]; then
+ msg_error "codename not specified"
+ exit 1
+elif [[ -z "${locale_name}" ]]; then
+ msg_error "Locale not specified"
+ exit 1
+fi
+
+
+pkgdir_name="packages-repo"
+
+set +e
+
+
+#-- Detect package list to load --#
+# Add the files for each channel to the list of files to read.
+_loadfilelist=(
+ # share packages
+ $(ls ${share_dir}/${pkgdir_name}.${arch}/*.${arch} 2> /dev/null)
+ "${share_dir}/${pkgdir_name}.${arch}/lang/${locale_name}.${arch}"
+
+ # channel packages
+ $(ls ${channel_dir}/${pkgdir_name}.${arch}/*.${arch} 2> /dev/null)
+ "${channel_dir}/${pkgdir_name}.${arch}/lang/${locale_name}.${arch}"
+)
+
+# Plymouth package list
+if [[ "${boot_splash}" = true ]]; then
+ _loadfilelist+=(
+ $(ls ${share_dir}/${pkgdir_name}.${arch}/plymouth/*.${arch} 2> /dev/null)
+ $(ls ${channel_dir}/${pkgdir_name}.${arch}/plymouth/*.${arch} 2> /dev/null)
+ )
+fi
+
+
+#-- Read package list --#
+# Read the file and remove comments starting with # and add it to the list of packages to install.
+for _file in ${_loadfilelist[@]}; do
+ if [[ -f "${_file}" ]]; then
+ msg_debug "Loaded package file ${_file}"
+ _pkglist=( ${_pkglist[@]} "$(grep -h -v ^'#' ${_file})" )
+ fi
+done
+
+#-- Read exclude list --#
+# Exclude packages from the share exclusion list
+_excludefile=(
+ "${share_dir}/${pkgdir_name}.${arch}/exclude"
+ "${channel_dir}/${pkgdir_name}.${arch}/exclude"
+)
+
+for _file in ${_excludefile[@]}; do
+ if [[ -f "${_file}" ]]; then
+ _excludelist=( ${_excludelist[@]} $(grep -h -v ^'#' "${_file}") )
+ fi
+done
+
+#-- excludeに記述されたパッケージを除外 --#
+# _pkglistを_subpkglistにコピーしexcludeのパッケージを除外し再代入
+_subpkglist=(${_pkglist[@]})
+unset _pkglist
+for _pkg in ${_subpkglist[@]}; do
+ # もし変数_pkgの値が配列_excludelistに含まれていなかったらpkglistに追加する
+ if [[ ! $(printf '%s\n' "${_excludelist[@]}" | grep -qx "${_pkg}"; echo -n ${?} ) = 0 ]]; then
+ _pkglist=(${_pkglist[@]} "${_pkg}")
+ fi
+done
+unset _subpkglist
+
+#-- excludeされたパッケージを表示 --#
+if [[ -n "${_excludelist[*]}" ]]; then
+ msg_debug "The following packages have been removed from the installation list."
+ msg_debug "Excluded packages: ${_excludelist[*]}"
+fi
+
+# Sort the list of packages in abc order.
+_pkglist=($(for _pkg in ${_pkglist[@]}; do echo "${_pkg}"; done | sort | perl -pe 's/\n/ /g'))
+
+echo "${_pkglist[@]}" | sed -e "s/\${codename}/${codename}/g" >&1
--- /dev/null
+#!/usr/bin/env bash
+
+set -e
+
+script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && cd .. && pwd )"
+share_dir="${script_path}/channels/share"
+
+boot_splash=false
+pkgdir_name="packages"
+
+arch=""
+channel_dir=""
+kernel=""
+locale_name=""
+
+#arch="x86_64"
+#channel_dir="${script_path}/channels/xfce"
+#kernel="zen"
+#locale_name="en"
+
+_help() {
+ echo "usage ${0} [options] [command]"
+ echo
+ echo "Get a list of packages to install on that channel"
+ echo
+ echo " General options:"
+ echo " -a | --arch [arch] Specify the architecture"
+ echo " -b | --boot-splash Enable boot splash"
+ echo " -c | --channel Specify the channel directory"
+ echo " -k | --kernel Specify the kernel"
+ echo " -h | --help This help message"
+}
+
+# Usage: getclm <number>
+# 標準入力から値を受けとり、引数で指定された列を抽出します。
+getclm() {
+ echo "$(cat -)" | cut -d " " -f "${1}"
+}
+
+# Message functions
+msg_error() {
+ "${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Error" -r "red" error "${1}"
+}
+
+msg_info() {
+ "${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Info" -r "green" error "${1}"
+}
+
+msg_debug() {
+ "${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Debug" -r "magenta" error "${1}"
+}
+
+
+# Parse options
+ARGUMENT="${@}"
+_opt_short="a:bc:k:l:h"
+_opt_long="arch:,boot-splash,channel:,kernel:,locale:,help"
+OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- ${ARGUMENT})
+[[ ${?} != 0 ]] && exit 1
+
+eval set -- "${OPT}"
+unset OPT _opt_short _opt_long
+
+while true; do
+ case ${1} in
+ -a | --arch)
+ arch="${2}"
+ shift 2
+ ;;
+ -b | --boot-splash)
+ boot_splash=true
+ shift 1
+ ;;
+ -c | --channel)
+ channel_dir="${2}"
+ shift 2
+ ;;
+ -k | --kernel)
+ kernel="${2}"
+ shift 2
+ ;;
+ -l | --locale)
+ locale_name="${2}"
+ shift 2
+ ;;
+ -h | --help)
+ _help
+ exit 0
+ ;;
+ --)
+ shift 1
+ break
+ ;;
+
+ esac
+done
+
+
+if [[ -z "${arch}" ]]; then
+ msg_error "Architecture not specified"
+ exit 1
+elif [[ -z "${channel_dir}" ]]; then
+ msg_error "Channel directory not specified"
+ exit 1
+#elif [[ -z "${kernel}" ]]; then
+ #msg_error "kernel not specified"
+ #exit 1
+elif [[ -z "${locale_name}" ]]; then
+ msg_error "Locale not specified"
+ exit 1
+fi
+
+
+pkgdir_name="packages"
+
+set +e
+
+
+#-- Detect package list to load --#
+# Add the files for each channel to the list of files to read.
+_loadfilelist=(
+ # share packages
+ $(ls ${share_dir}/${pkgdir_name}.${arch}/*.${arch} 2> /dev/null)
+ "${share_dir}/${pkgdir_name}.${arch}/lang/${locale_name}.${arch}"
+
+ # channel packages
+ $(ls ${channel_dir}/${pkgdir_name}.${arch}/*.${arch} 2> /dev/null)
+ "${channel_dir}/${pkgdir_name}.${arch}/lang/${locale_name}.${arch}"
+
+ # kernel packages
+ "${share_dir}/${pkgdir_name}.${arch}/kernel/${kernel}.${arch}"
+ "${channel_dir}/${pkgdir_name}.${arch}/kernel/${kernel}.${arch}"
+)
+
+# Plymouth package list
+if [[ "${boot_splash}" = true ]]; then
+ _loadfilelist+=(
+ $(ls ${share_dir}/${pkgdir_name}.${arch}/plymouth/*.${arch} 2> /dev/null)
+ $(ls ${channel_dir}/${pkgdir_name}.${arch}/plymouth/*.${arch} 2> /dev/null)
+ )
+fi
+
+
+#-- Read package list --#
+# Read the file and remove comments starting with # and add it to the list of packages to install.
+for _file in ${_loadfilelist[@]}; do
+ if [[ -f "${_file}" ]]; then
+ msg_debug "Loaded package file ${_file}"
+ _pkglist=( ${_pkglist[@]} "$(grep -h -v ^'#' ${_file})" )
+ fi
+done
+
+#-- Read exclude list --#
+# Exclude packages from the share exclusion list
+_excludefile=(
+ "${share_dir}/${pkgdir_name}.${arch}/exclude"
+ "${channel_dir}/${pkgdir_name}.${arch}/exclude"
+)
+
+for _file in ${_excludefile[@]}; do
+ if [[ -f "${_file}" ]]; then
+ _excludelist=( ${_excludelist[@]} $(grep -h -v ^'#' "${_file}") )
+ fi
+done
+
+#-- excludeに記述されたパッケージを除外 --#
+# _pkglistを_subpkglistにコピーしexcludeのパッケージを除外し再代入
+_subpkglist=(${_pkglist[@]})
+unset _pkglist
+for _pkg in ${_subpkglist[@]}; do
+ # もし変数_pkgの値が配列_excludelistに含まれていなかったらpkglistに追加する
+ if [[ ! $(printf '%s\n' "${_excludelist[@]}" | grep -qx "${_pkg}"; echo -n ${?} ) = 0 ]]; then
+ _pkglist=(${_pkglist[@]} "${_pkg}")
+ fi
+done
+unset _subpkglist
+
+#-- excludeされたパッケージを表示 --#
+if [[ -n "${_excludelist[*]}" ]]; then
+ msg_debug "The following packages have been removed from the installation list."
+ msg_debug "Excluded packages: ${_excludelist[*]}"
+fi
+
+# Sort the list of packages in abc order.
+_pkglist=($(for _pkg in ${_pkglist[@]}; do echo "${_pkg}"; done | sort | perl -pe 's/\n/ /g'))
+
+echo "${_pkglist[@]}" >&1