sfs_comp="zstd"
sfs_comp_opt=""
gpg_key=""
+aur=false
# Show an INFO message
# $1: message string
if [[ ${gpg_key} ]]; then
_mksignature
fi
+ if [[ "${aur}" = true ]]; then
+ _umount_aur_airootfs
+ fi
}
# Install packages on airootfs.
_pacman_file "${pkg_list}"
}
+_umount_aur_airootfs() {
+ _msg_info "Unmounting ${work_dir}/airootfs"
+ umount -d "${work_dir}/airootfs"
+ _msg_info "Done!"
+ rmdir -rf "${work_dir}/airootfs"
+ rmdir -rf "${work_dir}/airootfs.img"
+}
+
+_create_img_sys() {
+ if [[ ! -e "${work_dir}/airootfs" ]]; then
+ _msg_error "The path '${work_dir}/airootfs' does not exist" 1
+ fi
+ _msg_info "Creating ext4 image of 32GiB..."
+ truncate -s 32G -- "${work_dir}/airootfs.img"
+ if [[ ${quiet} = "y" ]]; then
+ mkfs.ext4 -q -O '^has_journal,^resize_inode' -E 'lazy_itable_init=0' -m 0 -F -- "${work_dir}/airootfs.img"
+ else
+ mkfs.ext4 -O '^has_journal,^resize_inode' -E 'lazy_itable_init=0' -m 0 -F -- "${work_dir}/airootfs.img"
+ fi
+ tune2fs -c "0" -i "0" "${work_dir}/airootfs.img"
+ _msg_info "Done!"
+
+ #_msg_info "Mounting ${work_dir}/airootfs.img on ${work_dir}/airootfs"
+ mount "${work_dir}/airootfs.img" "${work_dir}/airootfs"
+ _msg_info "Done!"
+
+}
+
command_init() {
_show_config init
+ if [[ "${aur}" = true ]]; then
+ _create_img_sys
+ fi
_chroot_init
}
_chroot_run
}
-while getopts 'a:p:r:C:L:P:A:D:w:o:s:c:g:t:vhx' arg; do
+while getopts 'a:p:r:C:L:P:A:D:w:o:s:c:g:t:vhx-:' arg; do
case "${arg}" in
a) arch="${OPTARG}" ;;
p) pkg_list="${pkg_list} ${OPTARG}" ;;
v) quiet="n" ;;
x) set -xv ;;
h|?) _usage 0 ;;
+ -)
+ case "${OPTARG}" in
+ "aur") aur=true ;;
+ "*")
+ _msg_error "Invalid argument '${arg}'" 0
+ _usage 1
+ ;;
+ ;;
+ esac
+ ;;
*)
_msg_error "Invalid argument '${arg}'" 0
_usage 1