Skip to content

Commit

Permalink
chdir to /opt instead of /root
Browse files Browse the repository at this point in the history
- certain base images don't have /root, or even
  worse,  /root is a symlink pointing to a dir
  that does not exist.  For now, just use /opt
  and create /opt if needed.
  • Loading branch information
atheurer committed Feb 4, 2025
1 parent e5ee1b0 commit 2e307ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions workshop.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1940,9 +1940,13 @@ sub update_container_pkgs {
exit(get_exit_code('chroot_failed'));
}

if (not chdir("/root")) {
if (not -e "/opt") {
mkdir("/opt")
}

if (not chdir("/opt")) {
logger('info', "failed\n", 2);
logger('error', "Could not chdir to /root!\n");
logger('error', "Could not chdir to /opt!\n");
exit(get_exit_code('chdir_failed'));
}

Expand Down

0 comments on commit 2e307ea

Please sign in to comment.