@@ -38,6 +38,16 @@ function remove_files ()
3838 fi
3939 # bo: variable
4040
41+ if [[ -d " ${PATH_TO_THE_ARCHLIVE_ROOT_USER} /document" ]];
42+ then
43+ rm -fr " ${PATH_TO_THE_ARCHLIVE_ROOT_USER} /document"
44+ fi
45+
46+ if [[ ! -d " ${PATH_TO_THE_ARCHLIVE_ROOT_USER} /software" ]];
47+ then
48+ rm -fr " ${PATH_TO_THE_ARCHLIVE_ROOT_USER} /document"
49+ fi
50+
4151 rm -fr " ${PATH_TO_THE_ARCHLIVE_ROOT} /var/lib/pacman/local/*"
4252 rm -fr " ${PATH_TO_THE_ARCHLIVE_ROOT} /var/lib/pacman/sync/*"
4353 rm -fr " ${PATH_TO_THE_ARCHLIVE_ROOT} /var/log/*.log"
@@ -47,9 +57,9 @@ function remove_files ()
4757# ###
4858# @param <string: PATH_TO_THE_ARCHLIVE_ROOT_USER> - this is not >>/<< but >>/root<<
4959# ###
50- function add_files ()
60+ function add_files_and_create_directories ()
5161{
52- _echo_if_be_verbose " :: Starting adding files"
62+ _echo_if_be_verbose " :: Starting adding files and creating directories "
5363
5464 # bo: variable
5565 local PATH_TO_THE_ARCHLIVE_ROOT_USER
@@ -395,11 +405,10 @@ function build_archiso ()
395405 # eo: variable
396406
397407 # bo: argument validation
398- _exit_if_string_is_empty " PATH_TO_THE_WORK_DIRECTORY" " ${PATH_TO_THE_WORK_DIRECTORY} "
399- _exit_if_string_is_empty " PATH_TO_THE_WORK_DIRECTORY" " ${PATH_TO_THE_WORK_DIRECTORY} "
400- _exit_if_string_is_empty " PATH_TO_THE_WORK_DIRECTORY" " ${PATH_TO_THE_WORK_DIRECTORY} "
401- _exit_if_string_is_empty " PATH_TO_THE_PROFILE_DIRECTORY" " ${PATH_TO_THE_WORK_DIRECTORY} "
402408 _exit_if_string_is_empty " ISO_FILE_PATH" " ${ISO_FILE_PATH} "
409+ _exit_if_string_is_empty " PATH_TO_THE_PROFILE_DIRECTORY" " ${PATH_TO_THE_WORK_DIRECTORY} "
410+ _exit_if_string_is_empty " PATH_TO_THE_OUTPUT_DIRECTORY" " ${PATH_TO_THE_OUTPUT_DIRECTORY} "
411+ _exit_if_string_is_empty " PATH_TO_THE_WORK_DIRECTORY" " ${PATH_TO_THE_WORK_DIRECTORY} "
403412 _exit_if_string_is_empty " SHA512_FILE_PATH" " ${SHA512_FILE_PATH} "
404413 # eo: argument validation
405414
@@ -1116,6 +1125,15 @@ function _main ()
11161125 ;;
11171126 esac
11181127 done
1128+
1129+ # we are calling this here to display the help as soon as possible without the need to call sudo
1130+ if [[ ${SHOW_HELP} -eq 1 ]];
1131+ then
1132+ echo " :: Usage"
1133+ echo " ${0} [-d|--dry-run] [-f|--force] [-g|--git-package] [-h|--help] [-k|--kernel <string: linux-lts>] [-r|--repo-index [<string: last|week|month|yyyy/mm/dd>]] [-u|--use-dkms] [-v|--verbose]"
1134+
1135+ exit 0
1136+ fi
11191137 # eo: user input
11201138
11211139 # begin of variables declaration
@@ -1138,16 +1156,6 @@ function _main ()
11381156 # end of variables declaration
11391157
11401158 # bo: code
1141- if [[ ${SHOW_HELP} -eq 1 ]];
1142- then
1143- echo " :: Usage"
1144- echo " ${0} [-d|--dry-run] [-f|--force] [-g|--git-package] [-h|--help] [-k|--kernel <string: linux-lts>] [-r|--repo-index [<string: last|week|month|yyyy/mm/dd>]] [-u|--use-dkms] [-v|--verbose]"
1145-
1146- exit 0
1147- fi
1148-
1149- # we are calling this here to display the help as soon as possible without the need to call sudo
1150-
11511159 if [[ ${BE_VERBOSE} -eq 1 ]];
11521160 then
11531161 GIT_CURL_VERBOSE=1
@@ -1170,7 +1178,7 @@ function _main ()
11701178 add_packages_and_repository " ${PATH_TO_THE_PROFILE_DIRECTORY} " " ${REPO_INDEX} "
11711179 fi
11721180
1173- add_files " ${PATH_TO_THE_PROFILE_DIRECTORY} /airootfs/root"
1181+ add_files_and_create_directories " ${PATH_TO_THE_PROFILE_DIRECTORY} /airootfs/root"
11741182
11751183 if [[ ${KERNEL} != ' linux' ]];
11761184 then
@@ -1192,10 +1200,10 @@ function _main ()
11921200 PATH_TO_SYSLINUX=" ${PATH_TO_THE_PROFILE_DIRECTORY} /syslinux"
11931201
11941202 # bo: efiboot adaptation
1195- sed -i " s/vmlinuz-linux/vmlinuz-${KERNEL} /" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /01-archiso-x86_64- linux.conf
1196- sed -i " s/initramfs-linux.img/initramfs-${KERNEL} .img/" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /01-archiso-x86_64- linux.conf
1197- sed -i " s/vmlinuz-linux/vmlinuz-${KERNEL} /" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /02-archiso-x86_64- speech-linux.conf
1198- sed -i " s/initramfs-linux.img/initramfs-${KERNEL} .img/" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /02 -archiso-x86_64-speech-linux .conf
1203+ sed -i " s/vmlinuz-linux/vmlinuz-${KERNEL} /" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /01-archiso-linux.conf
1204+ sed -i " s/initramfs-linux.img/initramfs-${KERNEL} .img/" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /01-archiso-linux.conf
1205+ sed -i " s/vmlinuz-linux/vmlinuz-${KERNEL} /" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /02-archiso-speech-linux.conf
1206+ sed -i " s/initramfs-linux.img/initramfs-${KERNEL} .img/" " ${PATH_TO_EFIBOOT_LOADER_ENTRIES} " /03 -archiso-memtest86+x64 .conf
11991207 # 03-* does not exist
12001208 # sed -i "s/vmlinuz-linux/vmlinuz-${KERNEL}/" "${PATH_TO_EFIBOOT_LOADER_ENTRIES}"/03-archiso-x86_64-ram-linux.conf
12011209 # sed -i "s/initramfs-linux.img/initramfs-${KERNEL}.img/" "${PATH_TO_EFIBOOT_LOADER_ENTRIES}"/03-archiso-x86_64-ram-linux.conf
@@ -1224,6 +1232,7 @@ function _main ()
12241232 # bo: profiledef adaptation
12251233 local PATH_TO_PROFILEDEF
12261234
1235+ # ref: /usr/share/doc/archiso/README.profile.rst
12271236 PATH_TO_PROFILEDEF=" ${PATH_TO_THE_PROFILE_DIRECTORY} /profiledef.sh"
12281237 sed -i " s/iso_name=\" archlinux\" /iso_name=\" ${BUILD_FILE_NAME} \" /" " ${PATH_TO_PROFILEDEF} "
12291238 # eo: profiledef adaptation
0 commit comments