2024-02-14 08:35:13 +00:00
|
|
|
#!/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
|
2024-02-26 04:43:40 +00:00
|
|
|
osi.sh:sudo cp -T --reflink=auto --archive -- "$arg_edit_base" "$arg_file"
|
2024-02-14 08:35:13 +00:00
|
|
|
fi
|
|
|
|
|
2024-02-26 04:43:40 +00:00
|
|
|
osi.sh:sudo mkdir -p "$arg_file"
|
|
|
|
|
2024-02-14 08:35:13 +00:00
|
|
|
mount_opt=bind
|
|
|
|
}
|
|
|
|
|
|
|
|
format_after:dir() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
shellcheck:format
|