forked from mirrored-repos/manjaro-tools
Compare commits
19 commits
master
...
stable-0.1
Author | SHA1 | Date | |
---|---|---|---|
|
d33c5e61a6 | ||
|
f729d6cc0e | ||
|
0b138d9132 | ||
|
cd3938d41d | ||
|
ef2469e764 | ||
|
6a8518dc0f | ||
|
aa9bc91f5e | ||
|
a7af8cfb35 | ||
|
024a4fb7d0 | ||
|
47095986af | ||
|
5ae0bd5f20 | ||
|
cd376c8b4f | ||
|
c2d57e0529 | ||
|
118d70655f | ||
|
32c9f536cc | ||
|
c5bdff8471 | ||
|
6ff3c6804f | ||
|
c71e40d847 | ||
|
70b76db9fa |
7 changed files with 121 additions and 109 deletions
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
||||||
Version=0.11.6
|
Version=0.11.7
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
SYSCONFDIR = /etc
|
SYSCONFDIR = /etc
|
||||||
|
|
|
@ -51,7 +51,6 @@ show_profile(){
|
||||||
msg2 "start_openrc_live: %s" "${start_openrc_live[*]}"
|
msg2 "start_openrc_live: %s" "${start_openrc_live[*]}"
|
||||||
msg2 "disable_openrc: %s" "${disable_openrc[*]}"
|
msg2 "disable_openrc: %s" "${disable_openrc[*]}"
|
||||||
fi
|
fi
|
||||||
# msg2 "is_custom_pac_conf: %s" "${is_custom_pac_conf}"
|
|
||||||
fi
|
fi
|
||||||
reset_profile
|
reset_profile
|
||||||
}
|
}
|
||||||
|
@ -95,6 +94,7 @@ display_settings(){
|
||||||
msg2 "iso_checksum: %s" "${iso_checksum}"
|
msg2 "iso_checksum: %s" "${iso_checksum}"
|
||||||
msg2 "use_overlayfs: %s" "${use_overlayfs}"
|
msg2 "use_overlayfs: %s" "${use_overlayfs}"
|
||||||
${verbose} && msg2 "iso_fs: %s" "${iso_fs}"
|
${verbose} && msg2 "iso_fs: %s" "${iso_fs}"
|
||||||
|
msg2 "pacman_conf: %s" "${pacman_conf}"
|
||||||
|
|
||||||
msg "BUILD QUEUE:"
|
msg "BUILD QUEUE:"
|
||||||
run show_profile "${buildset_iso}"
|
run show_profile "${buildset_iso}"
|
||||||
|
|
|
@ -104,11 +104,17 @@
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-i systend|openrc</option></term>
|
<term><option>-i systemd|openrc</option></term>
|
||||||
|
|
||||||
<listitem><para>The init system on the iso</para></listitem>
|
<listitem><para>The init system on the iso</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>-s</option></term>
|
||||||
|
|
||||||
|
<listitem><para>Sign the iso.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-k linuxXXX</option></term>
|
<term><option>-k linuxXXX</option></term>
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ gen_boot_image(){
|
||||||
|
|
||||||
copy_efi_loaders(){
|
copy_efi_loaders(){
|
||||||
msg2 "Copying efi loaders ..."
|
msg2 "Copying efi loaders ..."
|
||||||
cp $1/usr/lib/prebootloader/PreLoader.efi $2/bootx64.efi
|
cp $1/usr/share/efitools/efi/PreLoader.efi $2/bootx64.efi
|
||||||
cp $1/usr/lib/prebootloader/HashTool.efi $2/
|
cp $1/usr/share/efitools/efi/HashTool.efi $2/
|
||||||
cp $1/usr/lib/systemd/boot/efi/systemd-bootx64.efi $2/loader.efi
|
cp $1/usr/lib/systemd/boot/efi/systemd-bootx64.efi $2/loader.efi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,28 +11,30 @@
|
||||||
|
|
||||||
write_calamares_branding_desc(){
|
write_calamares_branding_desc(){
|
||||||
local conf="$1/usr/share/calamares/branding/sonar/branding.desc"
|
local conf="$1/usr/share/calamares/branding/sonar/branding.desc"
|
||||||
|
if [[ -f "$conf" ]];then
|
||||||
echo '---' > "$conf"
|
echo '---' > "$conf"
|
||||||
echo "componentName: sonar" >> $conf
|
echo "componentName: sonar" >> "$conf"
|
||||||
echo '' >> $conf
|
echo '' >> $conf
|
||||||
echo 'strings:' >> $conf
|
echo 'strings:' >> $conf
|
||||||
echo " productName: ${dist_name} GNU Linux" >> $conf
|
echo " productName: ${dist_name} GNU Linux" >> "$conf"
|
||||||
echo " shortProductName: ${dist_name}" >> $conf
|
echo " shortProductName: ${dist_name}" >> "$conf"
|
||||||
echo " version: ${dist_release}" >> $conf
|
echo " version: ${dist_release}" >> "$conf"
|
||||||
echo " shortVersion: ${dist_release}" >> $conf
|
echo " shortVersion: ${dist_release}" >> "$conf"
|
||||||
echo " versionedName: ${dist_name} GNU Linux ${dist_release}" >> $conf
|
echo " versionedName: ${dist_name} GNU Linux ${dist_release}" >> "$conf"
|
||||||
echo " shortVersionedName: ${dist_name} Linux ${dist_release}" >> $conf
|
echo " shortVersionedName: ${dist_name} Linux ${dist_release}" >> "$conf"
|
||||||
echo " bootloaderEntryName: ${dist_name}" >> $conf
|
echo " bootloaderEntryName: ${dist_name}" >> "$conf"
|
||||||
echo '' >> $conf
|
echo '' >> $conf
|
||||||
echo 'images:' >> $conf
|
echo 'images:' >> $conf
|
||||||
echo ' productLogo: "squid.png"' >> $conf
|
echo ' productLogo: "squid.png"' >> "$conf"
|
||||||
echo ' productIcon: "logo.png"' >> $conf
|
echo ' productIcon: "logo.png"' >> "$conf"
|
||||||
echo ' productWelcome: "languages.png"' >> $conf
|
echo ' productWelcome: "languages.png"' >> "$conf"
|
||||||
echo '' >> $conf
|
echo '' >> $conf
|
||||||
echo 'slideshow: "show.qml"' >> $conf
|
echo 'slideshow: "show.qml"' >> "$conf"
|
||||||
echo 'style:' >> $conf
|
echo 'style:' >> $conf
|
||||||
echo ' sidebarBackground: "#292F34"' >> $conf
|
echo ' sidebarBackground: "#292F34"' >> "$conf"
|
||||||
echo ' sidebarText: "#FFFFFF"' >> $conf
|
echo ' sidebarText: "#FFFFFF"' >> "$conf"
|
||||||
echo ' sidebarTextSelect: "#292F34"' >> $conf
|
echo ' sidebarTextSelect: "#292F34"' >> "$conf"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
write_calamares_machineid_conf(){
|
write_calamares_machineid_conf(){
|
||||||
|
@ -201,7 +203,7 @@ write_cli_inst_conf(){
|
||||||
echo "iso_name=${iso_name}" >> ${conf}
|
echo "iso_name=${iso_name}" >> ${conf}
|
||||||
echo '' >> ${conf}
|
echo '' >> ${conf}
|
||||||
echo '# kernel' >> ${conf}
|
echo '# kernel' >> ${conf}
|
||||||
echo "kernnel=${kernel}" >> ${conf}
|
echo "kernel=${kernel}" >> ${conf}
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_cli_inst(){
|
configure_cli_inst(){
|
||||||
|
|
|
@ -59,25 +59,6 @@ run_safe() {
|
||||||
set +e
|
set +e
|
||||||
}
|
}
|
||||||
|
|
||||||
# clean_pacman_conf(){
|
|
||||||
# local repositories=$(get_repos "${pacman_conf}") uri='file://'
|
|
||||||
# msg "Cleaning [%s/etc/pacman.conf] ..." "$1"
|
|
||||||
# for repo in ${repositories[@]}; do
|
|
||||||
# case ${repo} in
|
|
||||||
# 'options'|'core'|'extra'|'community'|'multilib') continue ;;
|
|
||||||
# *)
|
|
||||||
# msg2 "parsing [%s] ..." "${repo}"
|
|
||||||
# parse_section "${repo}" "${pacman_conf}"
|
|
||||||
# if [[ ${pc_value} == $uri* ]]; then
|
|
||||||
# msg2 "Removing local repo [%s] ..." "${repo}"
|
|
||||||
# sed -i "/^\[${repo}/,/^Server/d" $1/etc/pacman.conf
|
|
||||||
# fi
|
|
||||||
# ;;
|
|
||||||
# esac
|
|
||||||
# done
|
|
||||||
# msg "Done cleaning [%s/etc/pacman.conf]" "$1"
|
|
||||||
# }
|
|
||||||
|
|
||||||
# $1: image path
|
# $1: image path
|
||||||
make_sqfs() {
|
make_sqfs() {
|
||||||
if [[ ! -d "$1" ]]; then
|
if [[ ! -d "$1" ]]; then
|
||||||
|
@ -204,6 +185,13 @@ gen_iso_fn(){
|
||||||
echo $name
|
echo $name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset_pac_conf(){
|
||||||
|
info "Restoring [%s/etc/pacman.conf] ..." "$1"
|
||||||
|
sed -e 's|^.*HoldPkg.*|HoldPkg = pacman glibc manjaro-system|' \
|
||||||
|
-e "s|^.*#CheckSpace|CheckSpace|" \
|
||||||
|
-i "$1/etc/pacman.conf"
|
||||||
|
}
|
||||||
|
|
||||||
# Base installation (root-image)
|
# Base installation (root-image)
|
||||||
make_image_root() {
|
make_image_root() {
|
||||||
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
|
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
|
||||||
|
@ -216,7 +204,9 @@ make_image_root() {
|
||||||
pacman -Qr "${path}" > "${path}/root-image-pkgs.txt"
|
pacman -Qr "${path}" > "${path}/root-image-pkgs.txt"
|
||||||
copy_overlay "${profile_dir}/root-overlay" "${path}"
|
copy_overlay "${profile_dir}/root-overlay" "${path}"
|
||||||
configure_root_image "${path}"
|
configure_root_image "${path}"
|
||||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
|
||||||
|
reset_pac_conf "${path}"
|
||||||
|
|
||||||
clean_up_image "${path}"
|
clean_up_image "${path}"
|
||||||
: > ${work_dir}/build.${FUNCNAME}
|
: > ${work_dir}/build.${FUNCNAME}
|
||||||
msg "Done [Base installation] (root-image)"
|
msg "Done [Base installation] (root-image)"
|
||||||
|
@ -237,7 +227,8 @@ make_image_custom() {
|
||||||
cp "${path}/${profile}-image-pkgs.txt" ${iso_dir}/$(gen_iso_fn)-pkgs.txt
|
cp "${path}/${profile}-image-pkgs.txt" ${iso_dir}/$(gen_iso_fn)-pkgs.txt
|
||||||
[[ -e ${profile_dir}/${profile}-overlay ]] && copy_overlay "${profile_dir}/${profile}-overlay" "${path}"
|
[[ -e ${profile_dir}/${profile}-overlay ]] && copy_overlay "${profile_dir}/${profile}-overlay" "${path}"
|
||||||
configure_custom_image "${path}"
|
configure_custom_image "${path}"
|
||||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
|
||||||
|
reset_pac_conf "${path}"
|
||||||
|
|
||||||
umount_image
|
umount_image
|
||||||
clean_up_image "${path}"
|
clean_up_image "${path}"
|
||||||
|
@ -267,7 +258,8 @@ make_image_live() {
|
||||||
pacman -Qr "${path}" > "${path}/live-image-pkgs.txt"
|
pacman -Qr "${path}" > "${path}/live-image-pkgs.txt"
|
||||||
copy_overlay "${profile_dir}/live-overlay" "${path}"
|
copy_overlay "${profile_dir}/live-overlay" "${path}"
|
||||||
configure_live_image "${path}"
|
configure_live_image "${path}"
|
||||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
|
||||||
|
reset_pac_conf "${path}"
|
||||||
|
|
||||||
umount_image
|
umount_image
|
||||||
|
|
||||||
|
@ -287,7 +279,7 @@ make_image_mhwd() {
|
||||||
|
|
||||||
mount_image_select "${path}"
|
mount_image_select "${path}"
|
||||||
|
|
||||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
reset_pac_conf "${path}"
|
||||||
|
|
||||||
download_to_cache "${path}" "${packages}"
|
download_to_cache "${path}" "${packages}"
|
||||||
|
|
||||||
|
@ -363,7 +355,7 @@ make_efiboot() {
|
||||||
local path_iso="${work_dir}/iso"
|
local path_iso="${work_dir}/iso"
|
||||||
mkdir -p ${path_iso}/EFI/miso
|
mkdir -p ${path_iso}/EFI/miso
|
||||||
truncate -s ${efi_part_size} ${path_iso}/EFI/miso/${iso_name}.img
|
truncate -s ${efi_part_size} ${path_iso}/EFI/miso/${iso_name}.img
|
||||||
mkfs.vfat -n MISO_EFI ${path_iso}/EFI/miso/${iso_name}.img
|
mkfs.fat -n MISO_EFI ${path_iso}/EFI/miso/${iso_name}.img
|
||||||
mkdir -p ${work_dir}/efiboot
|
mkdir -p ${work_dir}/efiboot
|
||||||
mount ${path_iso}/EFI/miso/${iso_name}.img ${work_dir}/efiboot
|
mount ${path_iso}/EFI/miso/${iso_name}.img ${work_dir}/efiboot
|
||||||
local path_efi="${work_dir}/efiboot/EFI"
|
local path_efi="${work_dir}/efiboot/EFI"
|
||||||
|
@ -526,16 +518,6 @@ load_pkgs(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_custom_pacman_conf(){
|
|
||||||
# if [[ -f ${profile_dir}/pacman-${pacman_conf_arch}.conf ]]; then
|
|
||||||
# pacman_conf="${profile_dir}/pacman-${pacman_conf_arch}.conf"
|
|
||||||
# is_custom_pac_conf=true
|
|
||||||
# else
|
|
||||||
pacman_conf="${DATADIR}/pacman-${pacman_conf_arch}.conf"
|
|
||||||
# is_custom_pac_conf=false
|
|
||||||
# fi
|
|
||||||
}
|
|
||||||
|
|
||||||
check_profile(){
|
check_profile(){
|
||||||
local keyfiles=("${profile_dir}/mkinitcpio.conf"
|
local keyfiles=("${profile_dir}/mkinitcpio.conf"
|
||||||
"${profile_dir}/Packages-Root"
|
"${profile_dir}/Packages-Root"
|
||||||
|
@ -663,15 +645,28 @@ make_profile(){
|
||||||
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_pacman_conf(){
|
||||||
|
local user_conf=${profile_dir}/user-repos.conf
|
||||||
|
if [[ -f ${user_conf} ]];then
|
||||||
|
info "detected: %s" "user-repos.conf"
|
||||||
|
check_user_repos_conf "${user_conf}"
|
||||||
|
local conf=/tmp/custom-pacman.conf
|
||||||
|
cat ${DATADIR}/pacman-${pacman_conf_arch}.conf > "$conf"
|
||||||
|
cat ${user_conf} >> "$conf"
|
||||||
|
pacman_conf="$conf"
|
||||||
|
else
|
||||||
|
pacman_conf="${DATADIR}/pacman-${pacman_conf_arch}.conf"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
load_profile(){
|
load_profile(){
|
||||||
conf="${profile_dir}/profile.conf"
|
conf="${profile_dir}/profile.conf"
|
||||||
|
|
||||||
info "Profile: [%s]" "${profile}"
|
info "Profile: [%s]" "${profile}"
|
||||||
|
|
||||||
load_profile_config "$conf"
|
load_profile_config "$conf"
|
||||||
|
|
||||||
# check_custom_pacman_conf
|
set_pacman_conf
|
||||||
|
|
||||||
pacman_conf="${DATADIR}/pacman-${pacman_conf_arch}.conf"
|
|
||||||
|
|
||||||
iso_file=$(gen_iso_fn).iso
|
iso_file=$(gen_iso_fn).iso
|
||||||
|
|
||||||
|
|
97
lib/util.sh
97
lib/util.sh
|
@ -9,49 +9,58 @@
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
# $1: section
|
# $1: section
|
||||||
# parse_section() {
|
parse_section() {
|
||||||
# local is_section=0
|
local is_section=0
|
||||||
# while read line; do
|
while read line; do
|
||||||
# [[ $line =~ ^\ {0,}# ]] && continue
|
[[ $line =~ ^\ {0,}# ]] && continue
|
||||||
# [[ -z "$line" ]] && continue
|
[[ -z "$line" ]] && continue
|
||||||
# if [ $is_section == 0 ]; then
|
if [ $is_section == 0 ]; then
|
||||||
# if [[ $line =~ ^\[.*?\] ]]; then
|
if [[ $line =~ ^\[.*?\] ]]; then
|
||||||
# line=${line:1:$((${#line}-2))}
|
line=${line:1:$((${#line}-2))}
|
||||||
# section=${line// /}
|
section=${line// /}
|
||||||
# if [[ $section == $1 ]]; then
|
if [[ $section == $1 ]]; then
|
||||||
# is_section=1
|
is_section=1
|
||||||
# continue
|
continue
|
||||||
# fi
|
fi
|
||||||
# continue
|
continue
|
||||||
# fi
|
fi
|
||||||
# elif [[ $line =~ ^\[.*?\] && $is_section == 1 ]]; then
|
elif [[ $line =~ ^\[.*?\] && $is_section == 1 ]]; then
|
||||||
# break
|
break
|
||||||
# else
|
else
|
||||||
# pc_key=${line%%=*}
|
pc_key=${line%%=*}
|
||||||
# pc_key=${pc_key// /}
|
pc_key=${pc_key// /}
|
||||||
# pc_value=${line##*=}
|
pc_value=${line##*=}
|
||||||
# pc_value=${pc_value## }
|
pc_value=${pc_value## }
|
||||||
# eval "$pc_key='$pc_value'"
|
eval "$pc_key='$pc_value'"
|
||||||
# fi
|
fi
|
||||||
# done < "$2"
|
done < "$2"
|
||||||
# }
|
}
|
||||||
#
|
|
||||||
# get_repos() {
|
get_repos() {
|
||||||
# local section repos=() filter='^\ {0,}#'
|
local section repos=() filter='^\ {0,}#'
|
||||||
# while read line; do
|
while read line; do
|
||||||
# [[ $line =~ "${filter}" ]] && continue
|
[[ $line =~ "${filter}" ]] && continue
|
||||||
# [[ -z "$line" ]] && continue
|
[[ -z "$line" ]] && continue
|
||||||
# if [[ $line =~ ^\[.*?\] ]]; then
|
if [[ $line =~ ^\[.*?\] ]]; then
|
||||||
# line=${line:1:$((${#line}-2))}
|
line=${line:1:$((${#line}-2))}
|
||||||
# section=${line// /}
|
section=${line// /}
|
||||||
# case ${section} in
|
case ${section} in
|
||||||
# "options") continue ;;
|
"options") continue ;;
|
||||||
# *) repos+=("${section}") ;;
|
*) repos+=("${section}") ;;
|
||||||
# esac
|
esac
|
||||||
# fi
|
fi
|
||||||
# done < "$1"
|
done < "$1"
|
||||||
# echo ${repos[@]}
|
echo ${repos[@]}
|
||||||
# }
|
}
|
||||||
|
|
||||||
|
check_user_repos_conf(){
|
||||||
|
local repositories=$(get_repos "$1") uri='file://'
|
||||||
|
for repo in ${repositories[@]}; do
|
||||||
|
msg2 "parsing repo [%s] ..." "${repo}"
|
||||||
|
parse_section "${repo}" "$1"
|
||||||
|
[[ ${pc_value} == $uri* ]] && die "Using local repositories is not supported!"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
read_set(){
|
read_set(){
|
||||||
local _space="s| ||g" \
|
local _space="s| ||g" \
|
||||||
|
@ -407,7 +416,7 @@ load_profile_config(){
|
||||||
[[ -z ${password} ]] && password="manjaro"
|
[[ -z ${password} ]] && password="manjaro"
|
||||||
|
|
||||||
if [[ -z ${addgroups} ]];then
|
if [[ -z ${addgroups} ]];then
|
||||||
addgroups="video,audio,power,disk,storage,optical,network,lp,scanner,wheel"
|
addgroups="video,power,disk,storage,optical,network,lp,scanner,wheel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z ${start_systemd[@]} ]];then
|
if [[ -z ${start_systemd[@]} ]];then
|
||||||
|
|
Loading…
Reference in a new issue