# Compress tarball
make_tarball() {
- cp -a -l -f "${work_dir}/${arch}/airootfs" "${work_dir}/${arch}/airootfs-tarball"
+ cp -a -l -f "${work_dir}/${arch}/airootfs" "${work_dir}"
if [[ -f "${work_dir}/${arch}/airootfs/root/optimize_for_tarball.sh" ]]; then
chmod 755 "${work_dir}/${arch}/airootfs/root/optimize_for_tarball.sh"
fi
- arch-chroot "${work_dir}/${arch}/airootfs-tarball" "/root/optimize_for_tarball.sh" -u ${username}
+ arch-chroot "${work_dir}/airootfs" "/root/optimize_for_tarball.sh" -u ${username}
if [[ "${kernel}" = "core" ]]; then
- arch-chroot "${work_dir}/${arch}/airootfs-tarball" mkinitcpio -p linux
+ arch-chroot "${work_dir}/airootfs" mkinitcpio -p linux
else
- arch-chroot "${work_dir}/${arch}/airootfs-tarball" mkinitcpio -p linux-${kernel}
+ arch-chroot "${work_dir}/airootfs" mkinitcpio -p linux-${kernel}
fi
${mkalteriso} ${mkalteriso_option} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -P "${iso_publisher}" -A "${iso_application}" -o "${out_dir}" tarball "$(echo ${iso_filename} | sed 's/\.[^\.]*$//').tar.xz"
- remove "${work_dir}/${arch}/airootfs-tarball"
+ remove "${work_dir}/airootfs"
}
# Build airootfs filesystem image
# # Compress tarball from "iso" directory.
command_tarball () {
+ if [[ ! -e "${work_dir}/airootfs" ]]; then
+ _msg_error "The path '${work_dir}/airootfs' does not exist" 1
+ fi
+
mkdir -p "${out_dir}"
_msg_info "Creating tarball..."
local tar_path="$(realpath ${out_dir})/${tarball_name}"
- cd "${work_dir}/${arch}/airootfs-tarball"
+ cd "${work_dir}/airootfs"
- # tar.xz
tar -J -p -c ${_vflag} -f "${tar_path}" ./*
cdback