osi-tools/lib/mk/format-dir.sh

43 lines
885 B
Bash

#!/hint/bash
# Copyright (C) 2024 Umorpha Systems
# SPDX-License-Identifier: AGPL-3.0-or-later
source "${install_prefix}/lib/mk/shellcheck.sh"
formats+=('dir')
format_is_block['dir']='false'
# Option parsing #####################################################
format_options['dir']=''
format_checkconf:dir() {
shellcheck:format_checkconf
if [[ ${arg_conf[bootloader]} != none ]]; then
argparse:error '--conf=format=dir requires --conf=bootloader=none'
fi
}
# format_is_block[…]='false' settings ################################
format_wants_tmpfs['dir']='false'
format_after_clamps_mtime['dir']='false'
format_before:dir() {
shellcheck:format_before
if [[ -n $arg_edit_base ]]; then
osi.sh:sudo cp -T --reflink=auto --archive -- "$arg_edit_base" "$arg_file"
fi
osi.sh:sudo mkdir -p "$arg_file"
mount_opt=bind
}
format_after:dir() {
:
}
shellcheck:format