Allow custom image names with ARKANIUN_OVERWRITE_RANDOM
This commit is contained in:
parent
a7efb7ccfe
commit
f00b1f53b7
1 changed files with 8 additions and 1 deletions
|
@ -58,7 +58,11 @@ cleanup_and_quit () {
|
||||||
# image names
|
# image names
|
||||||
gen_random_string () {
|
gen_random_string () {
|
||||||
|
|
||||||
|
if [[ -e $ARKANIUM_OVERWRITE_RANDOM ]]; then
|
||||||
|
random=$ARKANIUM_OVERWRITE_RANDOM
|
||||||
|
else
|
||||||
random=$(openssl rand -hex 100 | head -c 42)
|
random=$(openssl rand -hex 100 | head -c 42)
|
||||||
|
fi
|
||||||
|
|
||||||
printf "${random}\n"
|
printf "${random}\n"
|
||||||
|
|
||||||
|
@ -154,8 +158,11 @@ if [[ $type == 'archlinux' ]]; then
|
||||||
btrfs property set -ts $workdir/etc ro true
|
btrfs property set -ts $workdir/etc ro true
|
||||||
btrfs property set -ts $workdir/var ro true
|
btrfs property set -ts $workdir/var ro true
|
||||||
|
|
||||||
|
printf "\e[1;34m-->\e[0m\e[1m Generating psuedo-random image name...\e[0m\n"
|
||||||
|
|
||||||
# Generate random name for new image
|
# Generate random name for new image
|
||||||
declare -r image_name=$(gen_random_string)
|
declare -r image_name=$(gen_random_string)
|
||||||
|
printf "$image_name\n"
|
||||||
|
|
||||||
# Create dir for storing the images
|
# Create dir for storing the images
|
||||||
mkdir -vp $(readlink -m $output_target/$image_name)
|
mkdir -vp $(readlink -m $output_target/$image_name)
|
||||||
|
|
Loading…
Add table
Reference in a new issue