Allow executing scripts while installing OS
This commit is contained in:
parent
9c1b81b4f4
commit
28fd9b8640
1 changed files with 16 additions and 5 deletions
|
@ -16,6 +16,21 @@ function runSetup
|
|||
echo "$PROJECT_CLONE_ROOT/$relativeDir/$relativePath"
|
||||
end
|
||||
|
||||
function runInOS -S
|
||||
set -l script "/root/run_once"
|
||||
wrapScript $argv | chroot "$mountDir" tee "$script"
|
||||
chroot "$mountDir" chmod +x "$script"
|
||||
chroot "$mountDir" "$script"
|
||||
chroot "$mountDir" rm "$script"
|
||||
end
|
||||
|
||||
function wrapScript -S
|
||||
printf %s\n \
|
||||
"cd $PROJECT_CLONE_ROOT" \
|
||||
"export CONFIG_MODULE=$(string escape (getCloneFile "$CONFIG_MODULE"))" \
|
||||
"$argv"
|
||||
end
|
||||
|
||||
getConfig valhalla.partition.script > "$script"
|
||||
bash "$script"
|
||||
and source "$dir/../../copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT"
|
||||
|
@ -31,11 +46,7 @@ function runSetup
|
|||
|
||||
and begin
|
||||
set -l script (string escape (getCloneFile (getInstallerScript)))
|
||||
printf %s\n \
|
||||
"cd $PROJECT_CLONE_ROOT" \
|
||||
"export CONFIG_MODULE=$(string escape (getCloneFile "$CONFIG_MODULE"))" \
|
||||
"export INSTALLER_SCRIPT=$script" \
|
||||
"$script"
|
||||
wrapScript "INSTALLER_SCRIPT=$(string escape "$script") $script"
|
||||
end | chroot "$mountDir" tee /root/.bash_profile > /dev/null
|
||||
|
||||
and echo "Setup finished!"
|
||||
|
|
Loading…
Reference in a new issue