manjaro-tools/lib/util-iso.sh

559 lines
16 KiB
Bash
Raw Normal View History

2014-12-08 23:50:56 +01:00
#!/bin/bash
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
2015-06-12 03:25:28 +02:00
import ${LIBDIR}/util-iso-image.sh
import ${LIBDIR}/util-iso-boot.sh
import ${LIBDIR}/util-yaml.sh
2016-02-27 00:39:58 +01:00
error_function() {
2016-09-15 23:58:18 +02:00
if [[ -p $logpipe ]]; then
rm "$logpipe"
fi
# first exit all subshells, then print the error
if (( ! BASH_SUBSHELL )); then
error "A failure occurred in %s()." "$1"
plain "Aborting..."
fi
umount_image
exit 2
2016-02-27 00:39:58 +01:00
}
# $1: function
run_log(){
2016-09-15 23:58:18 +02:00
local func="$1"
local tmpfile=${tmp_dir}/$func.ansi.log logfile=${log_dir}/$(gen_iso_fn).$func.log
logpipe=$(mktemp -u "${tmp_dir}/$func.pipe.XXXXXXXX")
mkfifo "$logpipe"
tee "$tmpfile" < "$logpipe" &
local teepid=$!
$func &> "$logpipe"
wait $teepid
rm "$logpipe"
cat $tmpfile | perl -pe 's/\e\[?.*?[\@-~]//g' > $logfile
rm "$tmpfile"
2016-02-27 00:39:58 +01:00
}
run_safe() {
2016-09-15 23:58:18 +02:00
local restoretrap func="$1"
set -e
set -E
restoretrap=$(trap -p ERR)
trap 'error_function $func' ERR
2016-02-27 00:39:58 +01:00
2016-09-15 23:58:18 +02:00
if ${verbose};then
run_log "$func"
else
"$func"
fi
2016-02-27 00:39:58 +01:00
2016-09-15 23:58:18 +02:00
eval $restoretrap
set +E
set +e
2016-02-27 00:39:58 +01:00
}
2016-06-13 21:48:41 +02:00
trap_exit() {
2016-09-15 23:58:18 +02:00
local sig=$1; shift
error "$@"
umount_image
trap -- "$sig"
kill "-$sig" "$$"
2016-06-13 21:48:41 +02:00
}
2015-05-11 12:47:02 +02:00
# $1: image path
2016-02-26 16:09:34 +01:00
make_sqfs() {
2016-09-15 23:58:18 +02:00
if [[ ! -d "$1" ]]; then
error "$1 is not a directory"
return 1
fi
local timer=$(get_timer) path=${iso_root}/${iso_name}/${target_arch}
2016-09-15 23:58:18 +02:00
local name=${1##*/}
local sq_img="${path}/$name.sqfs"
mkdir -p ${path}
msg "Generating SquashFS image for %s" "${1}"
if [[ -f "${sq_img}" ]]; then
local has_changed_dir=$(find ${1} -newer ${sq_img})
msg2 "Possible changes for %s ..." "${1}" >> ${tmp_dir}/buildiso.debug
msg2 "%s" "${has_changed_dir}" >> ${tmp_dir}/buildiso.debug
if [[ -n "${has_changed_dir}" ]]; then
msg2 "SquashFS image %s is not up to date, rebuilding..." "${sq_img}"
rm "${sq_img}"
else
msg2 "SquashFS image %s is up to date, skipping." "${sq_img}"
return
fi
fi
msg2 "Creating SquashFS image. This may take some time..."
local used_kernel=${kernel:5:1} mksqfs_args=(${1} ${sq_img} -noappend)
local highcomp="-b 256K -Xbcj x86"
[[ "${iso_compression}" != "xz" ]] && highcomp=""
if [[ "$name" == "mhwd-image" && ${used_kernel} < "4" ]]; then
mksqfs_args+=(-comp lz4)
if ${verbose};then
mksquashfs "${mksqfs_args[@]}" >/dev/null
else
mksquashfs "${mksqfs_args[@]}"
fi
else
mksqfs_args+=(-comp ${iso_compression} ${highcomp})
if ${verbose};then
mksquashfs "${mksqfs_args[@]}" >/dev/null
else
mksquashfs "${mksqfs_args[@]}"
fi
fi
show_elapsed_time "${FUNCNAME}" "${timer_start}"
2015-05-11 12:47:02 +02:00
}
2016-02-26 16:09:34 +01:00
assemble_iso(){
2016-09-15 23:58:18 +02:00
msg "Creating ISO image..."
local efi_boot_args=()
if [[ -f "${iso_root}/EFI/miso/efiboot.img" ]]; then
2016-09-15 23:58:18 +02:00
msg2 "Setting efi args. El Torito detected."
efi_boot_args=("-eltorito-alt-boot"
"-e EFI/miso/efiboot.img"
2016-09-15 23:58:18 +02:00
"-isohybrid-gpt-basdat"
"-no-emul-boot")
fi
xorriso -as mkisofs \
-iso-level 3 -rock -joliet \
-max-iso9660-filenames -omit-period \
-omit-version-number \
-relaxed-filenames -allow-lowercase \
-volid "${iso_label}" \
-appid "${iso_app_id}" \
-publisher "${iso_publisher}" \
-preparer "Prepared by manjaro-tools/${0##*/}" \
2016-10-08 21:22:32 +02:00
-eltorito-boot syslinux/isolinux.bin \
-eltorito-catalog syslinux/boot.cat \
2016-09-15 23:58:18 +02:00
-no-emul-boot -boot-load-size 4 -boot-info-table \
-isohybrid-mbr "${iso_root}/syslinux/isohdpfx.bin" \
2016-09-15 23:58:18 +02:00
${efi_boot_args[@]} \
-output "${iso_dir}/${iso_file}" \
"${iso_root}/"
}
# Build ISO
make_iso() {
2016-09-15 23:58:18 +02:00
msg "Start [Build ISO]"
touch "${iso_root}/.miso"
2016-10-10 22:07:49 +02:00
for d in $(find "${work_dir}" -maxdepth 1 -type d); do
if [[ "$d" != "${work_dir}" ]]; then
2016-09-15 23:58:18 +02:00
make_sqfs "$d"
fi
done
msg "Making bootable image"
# Sanity checks
[[ ! -d "${iso_root}" ]] && return 1
2016-09-15 23:58:18 +02:00
if [[ -f "${iso_dir}/${iso_file}" ]]; then
msg2 "Removing existing bootable image..."
rm -rf "${iso_dir}/${iso_file}"
fi
assemble_iso
msg "Done [Build ISO]"
}
2016-02-18 22:02:01 +01:00
gen_iso_fn(){
2016-09-15 23:58:18 +02:00
local vars=() name
vars+=("${iso_name}")
if ! ${chrootcfg};then
2016-09-15 23:58:18 +02:00
[[ -n ${profile} ]] && vars+=("${profile}")
fi
[[ ${initsys} == 'openrc' ]] && vars+=("${initsys}")
vars+=("${dist_release}")
vars+=("${target_branch}")
vars+=("${target_arch}")
for n in ${vars[@]};do
name=${name:-}${name:+-}${n}
done
echo $name
2016-02-18 22:02:01 +01:00
}
2016-05-21 00:05:49 +02:00
reset_pac_conf(){
2016-09-15 23:58:18 +02:00
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"
2016-05-21 00:05:49 +02:00
}
2014-12-08 23:50:56 +01:00
# Base installation (root-image)
2015-01-13 04:48:04 +01:00
make_image_root() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [Base installation] (root-image)"
local path="${work_dir}/root-image"
mkdir -p ${path}
2015-06-29 04:08:45 +02:00
2016-09-15 23:58:18 +02:00
chroot_create "${path}" "${packages}" || die
2015-06-29 04:08:45 +02:00
2016-09-15 23:58:18 +02:00
pacman -Qr "${path}" > "${path}/root-image-pkgs.txt"
copy_overlay "${profile_dir}/root-overlay" "${path}"
2016-05-20 19:42:16 +02:00
2016-09-15 23:58:18 +02:00
reset_pac_conf "${path}"
2016-05-20 19:42:16 +02:00
2016-09-15 23:58:18 +02:00
clean_up_image "${path}"
: > ${work_dir}/build.${FUNCNAME}
msg "Done [Base installation] (root-image)"
fi
2014-12-10 19:06:52 +01:00
}
make_image_custom() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [Desktop installation] (%s-image)" "${profile}"
local path="${work_dir}/${profile}-image"
mkdir -p ${path}
2016-09-15 23:58:18 +02:00
mount_image "${path}"
2016-09-15 23:58:18 +02:00
chroot_create "${path}" "${packages}"
2015-06-29 04:08:45 +02:00
2016-09-15 23:58:18 +02:00
pacman -Qr "${path}" > "${path}/${profile}-image-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}"
2016-09-15 23:58:18 +02:00
reset_pac_conf "${path}"
2016-05-20 19:42:16 +02:00
2016-09-15 23:58:18 +02:00
umount_image
clean_up_image "${path}"
: > ${work_dir}/build.${FUNCNAME}
msg "Done [Desktop installation] (%s-image)" "${profile}"
fi
2016-02-25 15:51:25 +01:00
}
mount_image_select(){
2016-09-15 23:58:18 +02:00
if [[ -f "${packages_custom}" ]]; then
mount_image_custom "$1"
else
mount_image "$1"
fi
2014-12-08 23:50:56 +01:00
}
2015-12-18 18:25:13 +01:00
make_image_live() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [Live installation] (live-image)"
local path="${work_dir}/live-image"
mkdir -p ${path}
2016-09-15 23:58:18 +02:00
mount_image_select "${path}"
2016-09-15 23:58:18 +02:00
chroot_create "${path}" "${packages}"
2015-06-29 04:08:45 +02:00
2016-09-15 23:58:18 +02:00
pacman -Qr "${path}" > "${path}/live-image-pkgs.txt"
copy_overlay "${profile_dir}/live-overlay" "${path}"
configure_live_image "${path}"
2016-09-15 23:58:18 +02:00
reset_pac_conf "${path}"
2016-05-20 19:42:16 +02:00
2016-09-15 23:58:18 +02:00
umount_image
2016-09-15 23:58:18 +02:00
# Clean up GnuPG keys
rm -rf "${path}/etc/pacman.d/gnupg"
clean_up_image "${path}"
: > ${work_dir}/build.${FUNCNAME}
msg "Done [Live installation] (live-image)"
fi
2014-12-15 23:12:04 +01:00
}
make_image_mhwd() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [drivers repository] (mhwd-image)"
local path="${work_dir}/mhwd-image"
mkdir -p ${path}${mhwd_repo}
2016-09-15 23:58:18 +02:00
mount_image_select "${path}"
2015-06-29 04:08:45 +02:00
2016-09-15 23:58:18 +02:00
reset_pac_conf "${path}"
2016-05-20 19:42:16 +02:00
2016-09-15 23:58:18 +02:00
copy_from_cache "${path}" "${packages}"
2015-07-04 12:09:39 +02:00
2016-09-15 23:58:18 +02:00
if [[ -n "${packages_cleanup}" ]]; then
for mhwd_clean in ${packages_cleanup}; do
rm ${path}${mhwd_repo}/${mhwd_clean}
done
fi
cp ${DATADIR}/pacman-mhwd.conf ${path}/opt
make_repo "${path}"
configure_mhwd_drivers "${path}"
2016-09-15 23:58:18 +02:00
umount_image
clean_up_image "${path}"
: > ${work_dir}/build.${FUNCNAME}
msg "Done [drivers repository] (mhwd-image)"
fi
2014-12-08 23:50:56 +01:00
}
2015-01-13 04:48:04 +01:00
make_image_boot() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [/iso/%s/boot]" "${iso_name}"
local path_iso="${iso_root}/${iso_name}/boot"
2016-09-15 23:58:18 +02:00
mkdir -p ${path_iso}/${target_arch}
cp ${work_dir}/root-image/boot/memtest86+/memtest.bin ${path_iso}/${target_arch}/memtest
2016-10-09 00:40:25 +02:00
cp ${work_dir}/root-image/boot/vmlinuz* ${path_iso}/${target_arch}/vmlinuz
2016-09-15 23:58:18 +02:00
local path="${work_dir}/boot-image"
mkdir -p ${path}
2015-06-25 09:59:35 +02:00
mount_image_live "${path}"
2016-09-15 23:58:18 +02:00
configure_plymouth "${path}"
2015-06-25 09:59:35 +02:00
2016-09-15 23:58:18 +02:00
copy_initcpio "${profile_dir}" "${path}"
2015-06-29 04:08:45 +02:00
2016-09-15 23:58:18 +02:00
gen_boot_image "${path}"
2015-06-29 04:08:45 +02:00
2016-10-09 00:40:25 +02:00
mv ${path}/boot/initramfs.img ${path_iso}/${target_arch}/initramfs.img
2016-09-15 23:58:18 +02:00
[[ -f ${path}/boot/intel-ucode.img ]] && copy_ucode "${path}" "${path_iso}"
2015-06-25 09:59:35 +02:00
2016-09-15 23:58:18 +02:00
umount_image
2015-06-25 09:59:35 +02:00
2016-09-15 23:58:18 +02:00
rm -R ${path}
: > ${work_dir}/build.${FUNCNAME}
msg "Done [/iso/%s/boot]" "${iso_name}"
2016-09-15 23:58:18 +02:00
fi
2014-12-08 23:50:56 +01:00
}
# Prepare /EFI
2016-10-06 20:53:10 +02:00
make_efi_usb() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [/iso/EFI]"
prepare_efi_loader "${work_dir}/live-image" "${iso_root}" "usb"
2016-09-15 23:58:18 +02:00
: > ${work_dir}/build.${FUNCNAME}
msg "Done [/iso/EFI]"
2016-09-15 23:58:18 +02:00
fi
2014-12-08 23:50:56 +01:00
}
# Prepare kernel.img::/EFI for "El Torito" EFI boot mode
2016-10-06 20:53:10 +02:00
make_efi_dvd() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [/efiboot/EFI]"
local miso=${iso_root}/EFI/miso
mkdir -p ${miso}
truncate -s 31M ${miso}/efiboot.img
mkfs.fat -n MISO_EFI ${miso}/efiboot.img
2016-10-03 22:45:53 +02:00
mkdir -p ${work_dir}/efiboot
mount ${miso}/efiboot.img ${work_dir}/efiboot
prepare_efiboot_image "${work_dir}" "${iso_root}"
prepare_efi_loader "${work_dir}/live-image" "${work_dir}/efiboot" "dvd"
umount -d ${work_dir}/efiboot
2016-10-10 22:07:49 +02:00
rm -r ${work_dir}/efiboot
2016-09-15 23:58:18 +02:00
: > ${work_dir}/build.${FUNCNAME}
msg "Done [/efiboot/EFI]"
2016-09-15 23:58:18 +02:00
fi
2014-12-08 23:50:56 +01:00
}
make_syslinux() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [/iso/syslinux]"
local syslinux=${iso_root}/syslinux
2016-10-08 21:22:32 +02:00
mkdir -p ${syslinux}
2016-10-10 22:07:49 +02:00
prepare_syslinux "${work_dir}/live-image" "${syslinux}"
2016-10-08 21:22:32 +02:00
mkdir -p ${syslinux}/hdt
gzip -c -9 ${work_dir}/root-image/usr/share/hwdata/pci.ids > ${syslinux}/hdt/pciids.gz
gzip -c -9 ${work_dir}/live-image/usr/lib/modules/*-MANJARO/modules.alias > ${syslinux}/hdt/modalias.gz
: > ${work_dir}/build.${FUNCNAME}
msg "Done [/iso/syslinux]"
fi
}
2014-12-08 23:50:56 +01:00
make_isomounts() {
2016-09-15 23:58:18 +02:00
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Prepare [/iso/%s/isomounts]" "${iso_name}"
write_isomounts "${iso_root}/${iso_name}"
2016-09-15 23:58:18 +02:00
: > ${work_dir}/build.${FUNCNAME}
msg "Done [/iso/%s/isomounts]" "${iso_name}"
2016-09-15 23:58:18 +02:00
fi
2014-12-08 23:50:56 +01:00
}
check_requirements(){
2016-09-15 23:58:18 +02:00
[[ -f ${run_dir}/.buildiso ]] || die "%s is not a valid iso profiles directory!" "${run_dir}"
if ! $(is_valid_arch_iso ${target_arch});then
die "%s is not a valid arch!" "${target_arch}"
fi
if ! $(is_valid_branch ${target_branch});then
die "%s is not a valid branch!" "${target_branch}"
fi
2016-09-15 23:58:18 +02:00
if ! is_valid_init "${initsys}";then
die "%s is not a valid init system!" "${initsys}"
fi
2016-09-15 23:58:18 +02:00
local iso_kernel=${kernel:5:1} host_kernel=$(uname -r)
2016-09-15 23:58:18 +02:00
if [[ ${iso_kernel} < "4" ]] || [[ ${host_kernel%%*.} < "4" ]];then
use_overlayfs='false'
fi
2016-09-15 23:58:18 +02:00
if ${use_overlayfs};then
iso_fs="overlayfs"
else
iso_fs="aufs"
fi
import ${LIBDIR}/util-iso-${iso_fs}.sh
}
2016-02-23 19:57:45 +01:00
sign_iso(){
2016-09-15 23:58:18 +02:00
su ${OWNER} -c "signfile ${iso_dir}/$1"
2016-02-22 19:24:49 +01:00
}
make_torrent(){
2016-09-15 23:58:18 +02:00
local fn=${iso_file}.torrent
msg2 "Creating (%s) ..." "${fn}"
[[ -f ${iso_dir}/${fn} ]] && rm ${iso_dir}/${fn}
mktorrent ${mktorrent_args[*]} -o ${iso_dir}/${fn} ${iso_dir}/${iso_file}
}
2016-09-22 08:44:39 +02:00
# $1: file
make_checksum(){
msg "Creating [%s] sum ..." "${iso_checksum}"
cd ${iso_dir}
local cs=$(${iso_checksum}sum $1)
msg2 "%s sum: %s" "${iso_checksum}" "${cs##*/}"
echo "${cs}" > ${iso_dir}/$1.${iso_checksum}
msg "Done [%s] sum" "${iso_checksum}"
}
2014-12-31 01:02:43 +01:00
compress_images(){
2016-09-15 23:58:18 +02:00
local timer=$(get_timer)
run_safe "make_iso"
make_checksum "${iso_file}"
${sign} && sign_iso "${iso_file}"
${torrent} && make_torrent
user_own "${iso_dir}" "-R"
show_elapsed_time "${FUNCNAME}" "${timer}"
2014-12-31 01:02:43 +01:00
}
2016-02-25 06:40:39 +01:00
prepare_images(){
2016-09-15 23:58:18 +02:00
local timer=$(get_timer)
load_pkgs "${profile_dir}/Packages-Root"
run_safe "make_image_root"
if [[ -f "${packages_custom}" ]] ; then
load_pkgs "${packages_custom}"
run_safe "make_image_custom"
fi
if [[ -f ${profile_dir}/Packages-Live ]]; then
load_pkgs "${profile_dir}/Packages-Live"
run_safe "make_image_live"
fi
if [[ -f ${packages_mhwd} ]] ; then
load_pkgs "${packages_mhwd}"
run_safe "make_image_mhwd"
fi
run_safe "make_image_boot"
run_safe "make_syslinux"
2016-09-15 23:58:18 +02:00
if [[ "${target_arch}" == "x86_64" ]]; then
2016-10-06 20:53:10 +02:00
run_safe "make_efi_usb"
run_safe "make_efi_dvd"
2016-09-15 23:58:18 +02:00
fi
run_safe "make_isomounts"
show_elapsed_time "${FUNCNAME}" "${timer}"
}
archive_logs(){
local name=$(gen_iso_fn) ext=log.tar.xz src=${tmp_dir}/archives.list
find ${log_dir} -maxdepth 1 -name "$name*.log" -printf "%f\n" > $src
msg2 "Archiving log files [%s] ..." "$name.$ext"
tar -cJf ${log_dir}/$name.$ext -C ${log_dir} -T $src
msg2 "Cleaning log files ..."
find ${log_dir} -maxdepth 1 -name "$name*.log" -delete
}
make_profile(){
2016-09-15 23:58:18 +02:00
msg "Start building [%s]" "${profile}"
${clean_first} && chroot_clean "${work_dir}" "${iso_root}"
2016-09-15 23:58:18 +02:00
if ${iso_only}; then
[[ ! -d ${work_dir} ]] && die "Create images: buildiso -p %s -x" "${profile}"
compress_images
${verbose} && archive_logs
exit 1
fi
if ${images_only}; then
prepare_images
${verbose} && archive_logs
warning "Continue compress: buildiso -p %s -zc ..." "${profile}"
exit 1
else
prepare_images
compress_images
${verbose} && archive_logs
fi
reset_profile
msg "Finished building [%s]" "${profile}"
show_elapsed_time "${FUNCNAME}" "${timer_start}"
}
2016-02-25 06:40:39 +01:00
2016-06-09 12:49:28 +02:00
get_pacman_conf(){
2016-09-15 23:58:18 +02:00
local user_conf=${profile_dir}/user-repos.conf pac_arch='default' conf
[[ "${target_arch}" == 'x86_64' ]] && pac_arch='multilib'
if [[ -f ${user_conf} ]];then
info "detected: %s" "user-repos.conf"
check_user_repos_conf "${user_conf}"
conf=${tmp_dir}/custom-pacman.conf
cat ${DATADIR}/pacman-$pac_arch.conf ${user_conf} > "$conf"
else
conf="${DATADIR}/pacman-$pac_arch.conf"
fi
echo "$conf"
}
gen_webseed(){
2016-09-15 23:58:18 +02:00
local webseed url project=$(get_project "${edition}")
url=${host}/project/${project}/${dist_release}/${profile}/${iso_file}
local mirrors=('heanet' 'jaist' 'netcologne' 'iweb' 'kent')
2016-09-15 23:58:18 +02:00
for m in ${mirrors[@]};do
webseed=${webseed:-}${webseed:+,}"http://${m}.dl.${url}"
done
echo ${webseed}
}
2016-02-25 06:40:39 +01:00
load_profile(){
2016-09-15 23:58:18 +02:00
conf="${profile_dir}/profile.conf"
2016-09-15 23:58:18 +02:00
info "Profile: [%s]" "${profile}"
2016-02-25 06:40:39 +01:00
2016-09-15 23:58:18 +02:00
load_profile_config "$conf"
2016-02-25 06:40:39 +01:00
2016-09-15 23:58:18 +02:00
pacman_conf=$(get_pacman_conf)
2016-09-15 23:58:18 +02:00
mirrors_conf=$(get_pac_mirrors_conf "${target_branch}")
2016-06-10 11:55:41 +02:00
2016-09-15 23:58:18 +02:00
iso_file=$(gen_iso_fn).iso
2016-02-25 06:40:39 +01:00
2016-09-15 23:58:18 +02:00
mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K)
work_dir=${chroots_iso}/${profile}/${target_arch}
2016-02-25 06:40:39 +01:00
2016-09-15 23:58:18 +02:00
iso_dir="${cache_dir_iso}/${edition}/${dist_release}/${profile}"
2016-02-25 06:40:39 +01:00
iso_root=${chroots_iso}/${profile}/iso
2016-09-15 23:58:18 +02:00
prepare_dir "${iso_dir}"
user_own "${iso_dir}"
2016-09-15 23:58:18 +02:00
mktorrent_args=(-v -p -l ${piece_size} -a ${tracker_url} -w $(gen_webseed))
2016-02-25 06:40:39 +01:00
}
prepare_profile(){
2016-09-15 23:58:18 +02:00
profile=$1
edition=$(get_edition ${profile})
profile_dir=${run_dir}/${edition}/${profile}
check_profile
load_profile
2016-02-25 06:40:39 +01:00
}
build(){
2016-09-15 23:58:18 +02:00
prepare_profile "$1"
make_profile
2016-02-25 06:40:39 +01:00
}