From 16d5edc27f3dc40d5530d22097f240859516c5dd Mon Sep 17 00:00:00 2001 From: Alex Martian Date: Wed, 12 Jun 2024 15:30:55 +0000 Subject: [PATCH] added _prepare script description to README; changes in _prepare to make parent folders for AppImages and added one mmore (new) variable to amend in _make_custom_liveusb.sh --- README.md | 6 ++++++ _prepare.sh | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5581108..ccccf56 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,12 @@ Other minor tweaks, including: - `_rename_based_on_meta.sh` - standalone script using ffmpeg - `_r_sync.sh` – not finalized try on using rsync to synchronize two folders both ways (see code and comments in the script how it works) +#### _prepare.sh + +- to (temporarily) amend `_make_custom_liveusb.sh` (variables mostly) and `bash_functions_and_other_config.sh` +- to make some changes to contents of $software_path_root about what applications (e.g. AppImage files) to install + + ### Examples #### Example 1 (to only add some software done with `apt-install` of deb files) diff --git a/_prepare.sh b/_prepare.sh index b722fb8..7b93fde 100755 --- a/_prepare.sh +++ b/_prepare.sh @@ -13,9 +13,10 @@ work_path="/media/disk1/work2" user_name="user2" locales='("en_US" "de_DE")' # note: string here whereas array in the file to edit cgroup="gr2" # see [1] for example of usage (in addition of moving process into a group) +cpu_max_chroot="500000 1000000" # limit for whole CPU, write quota and period (valid values in the range of 1000 to 1000000) in microseconds, for performance reasons could be better to use larger periods). Total CPU time in the system equals period multiplied by number of cores/processors cpu_max_mksquashfs="1200000 1000000" # applications to add -path_to_apps="//_toadd" # within software_path_root; double `/` instead of single for usage in bash pattern substitution +path_to_apps="//_to_add" # within software_path_root; double `/` instead of single for usage in bash pattern substitution apps_to_add=("kiwix" "kdenlive" "Kdenlive" "krita" "Krita" "jExifToolGUI") # doc files are named starting with Upper case letter, the rest with lower one, therefore list both variants # ----------------------------------------------------------- # @@ -38,6 +39,7 @@ change_variable original_iso change_variable work_path change_variable new_legacy_menu_title change_variable cgroup +change_variable cpu_max_chroot change_variable cpu_max_mksquashfs change_variable user_name @@ -79,12 +81,14 @@ find "${software_path_root}/to_root" -type l -execdir rm '{}' + find "${software_path_root}/bin" -type l -execdir rm '{}' + # add each for app in "${apps_to_add[@]}"; do - find "${software_path_root}/${path_to_apps}" -name "${app}"* -exec bash -c 'ln --symbolic --relative -T ${1} ${1/'"${path_to_apps}"'/}' bash {} \; + find "${software_path_root}/${path_to_apps}" -name "${app}"* -exec bash -c 'link_name="${1/'"${path_to_apps}"'/}"; mkdir --parents "$(dirname ${link_name})";ln --symbolic --relative -T "${1}" "${link_name}"' bash {} \; # ${parameter/pattern/string} Pattern substitution - here used to remove extra part of path done # end of script exit +########################################### +# Notes, useful code ########################################### # [1] @@ -128,7 +132,7 @@ else fi -# [2] Notes, useful code +# [2] # Useful to change something in all scripts find . -name '*.sh' -execdir bash -c 'sed -i '\''s|Exiting $0 on error $err| ERROR: Exiting $0 on error $err|'\'' "$0"' "{}" \;