Skip to content

Commit

Permalink
added _prepare script description to README; changes in _prepare to m…
Browse files Browse the repository at this point in the history
…ake parent folders for AppImages and added one mmore (new) variable to amend in _make_custom_liveusb.sh
  • Loading branch information
mars4science committed Jun 12, 2024
1 parent d10ad3c commit 16d5edc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions _prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

# ----------------------------------------------------------- #
Expand All @@ -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

Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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"' "{}" \;
Expand Down

0 comments on commit 16d5edc

Please sign in to comment.