Skip to content

Commit

Permalink
core: blueos_startup_update: ensure userdata structure exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Apr 20, 2023
1 parent 93a3b08 commit 30cc82b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/tools/blueos_startup_update/blueos_startup_update
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ def ensure_nginx_permissions() -> None:
command = "chown -R www-data:www-data /usr/blueos/userdata"
run_command(command, False)

def ensure_user_data_structure_is_in_place() -> None:
# ensures we have all base folders in userdata
commands = [
"mkdir -p /usr/blueos/userdata/images/vehicle",
"mkdir -p /usr/blueos/userdata/images/logo",
"mkdir -p /usr/blueos/userdata/styles",
]
for command in commands:
run_command(command, False)


def main() -> None:
current_git_version = os.getenv('GIT_DESCRIBE_TAGS')
match = re.match(r'(?P<tag>.*)-(?P<commit_number>\d+)-(?P<commit_hash>[a-z0-9]+)', current_git_version)
Expand All @@ -103,6 +114,7 @@ def main() -> None:
update_startup()
update_cgroups()
update_dwc2()
ensure_user_data_structure_is_in_place()
ensure_nginx_permissions()

if __name__ == "__main__":
Expand Down

0 comments on commit 30cc82b

Please sign in to comment.