I am writing a script to automate my Arch Linux installation process and I've bumped into an environmental problem. I have a file with the installation sequence and a file that holds all the functions, sourced in the beginning of the script.
Running arch-chroot /mnt /bin/bash -c someFunction
does not recognize the function nor the variables set before this line of code.
If I export -f someFunction
it will recognize the function, but someFunction
in itself is just a decomposition function, which only calls other functions. What is the most elegant way to source all the functions inside the chroot environment?
I also need a way of exporting all variables, set by the user at the beginning of the script, into the chrooted environment.(I'm guessing solving the above will also solve this problem)