From 9a647347c19a94bc25de0ca734c21f7aba49e0b1 Mon Sep 17 00:00:00 2001 From: felegy Date: Thu, 11 Jul 2024 09:20:34 +0000 Subject: [PATCH] Initial --- .devcontainer/devcontainer.json | 56 +++++++ .ecrc | 21 +++ .editorconfig | 26 +++ .github/workflows/ci.yaml | 31 ++++ .gitignore | 2 + .jsonyamlex | 2 + Brewfile | 8 + Brewfile.lock.json | 288 ++++++++++++++++++++++++++++++++ README.md | 223 +++++++++++++++++++++++++ 9 files changed, 657 insertions(+) create mode 100755 .devcontainer/devcontainer.json create mode 100644 .ecrc create mode 100644 .editorconfig create mode 100644 .github/workflows/ci.yaml create mode 100644 .gitignore create mode 100644 .jsonyamlex create mode 100644 Brewfile create mode 100644 Brewfile.lock.json create mode 100644 README.md diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100755 index 0000000..f12c4ce --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,56 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "DevOpsUbuntu", + "userEnvProbe": "loginInteractiveShell", + "image": "mcr.microsoft.com/vscode/devcontainers/base:0-ubuntu-22.04", + "runArgs": [ + "--privileged", + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + "remoteUser": "vscode", + "containerUser": "vscode", + "updateRemoteUserUID": true, + "mounts": ["source=brew,target=/home/linuxbrew,type=volume,consistency=cached"], + "features": { + "ghcr.io/meaningful-ooo/devcontainer-features/homebrew:2": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": true, + "installDockerBuildx": true, + "version": "latest", + "dockerDashComposeVersion": "v2" + }, + "ghcr.io/devcontainers-contrib/features/heroku-cli:1": {} + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "settings": { + "dotfiles.targetPath": "~/.dotfiles", + "dotfiles.repository": "https://github.com/hvg-dev/dotfiles.git", + "terminal.integrated.defaultProfile.linux": "zsh", + "terminal.integrated.shell.linux": "zsh", + "terminal.integrated.shellArgs.linux": [ "-l" ] + }, + "extensions": [ + "timonwong.shellcheck", + "ms-azuretools.vscode-docker", + "editorconfig.editorconfig", + "ms-vscode.makefile-tools", + "vscode-icons-team.vscode-icons" + ] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" + } diff --git a/.ecrc b/.ecrc new file mode 100644 index 0000000..31afeba --- /dev/null +++ b/.ecrc @@ -0,0 +1,21 @@ +{ + "Verbose": false, + "Debug": false, + "IgnoreDefaults": false, + "SpacesAftertabs": false, + "NoColor": false, + "Exclude": [ + ".git/", + "README.md" + ], + "AllowedContentTypes": [], + "PassedFiles": [], + "Disable": { + "EndOfLine": false, + "Indentation": false, + "IndentSize": false, + "InsertFinalNewline": false, + "TrimTrailingWhitespace": false, + "MaxLineLength": false + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4cb6375 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[{Makefile,**.mk}] +# Use tabs for indentation (Makefiles require tabs) +indent_style = tab + +[*.md] +trim_trailing_whitespace = false +indent_size = 2 + +[*.{yml,yaml,tf}] +indent_size = 2 + +[*.{json,ecrc}] +indent_size = 2 + +[*.{xml,conf}] +indent_size = 2 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c71f69d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: #kezi inditas + +jobs: + + check: + name: Check + runs-on: [ubuntu-latest] + + steps: + - uses: actions/checkout@master + - uses: editorconfig-checker/action-editorconfig-checker@main + - name: EditorConfig Check + run: editorconfig-checker + - name: Json / Yaml Validate + id: json-yaml-validate + uses: GrantBirki/json-yaml-validate@v2.4.0 + with: + comment: "true" + allow_multiple_documents: "true" + exclude_file: ".jsonyamlex" + - name: ShellCheck + uses: ludeeus/action-shellcheck@master + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: PS-Check + uses: SleepySysadmin/github-action-pscheck@master diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b643a3c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/* +!build/manifest.yaml diff --git a/.jsonyamlex b/.jsonyamlex new file mode 100644 index 0000000..fddeaec --- /dev/null +++ b/.jsonyamlex @@ -0,0 +1,2 @@ +# exclude devcontainer.json +.devcontainer/devcontainer.json diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..e33265b --- /dev/null +++ b/Brewfile @@ -0,0 +1,8 @@ +tap "homebrew/bundle" +brew "editorconfig-checker" +brew "shellcheck" +brew "direnv" +#brew "qemu" +brew "yq" +brew "jq" +vscode "Command is only available in WSL or inside a Visual Studio Code terminal." diff --git a/Brewfile.lock.json b/Brewfile.lock.json new file mode 100644 index 0000000..9ccb70a --- /dev/null +++ b/Brewfile.lock.json @@ -0,0 +1,288 @@ +{ + "entries": { + "tap": { + "homebrew/bundle": { + "revision": "0e8e000753e19b5422efb94a688abfd62c908fcb" + } + }, + "brew": { + "editorconfig-checker": { + "version": "3.0.3", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/editorconfig-checker/blobs/sha256:448f1ebb1897e6d07f5d6928066339ce01ea89f7e1f6e820bbbd483dafac853f", + "sha256": "448f1ebb1897e6d07f5d6928066339ce01ea89f7e1f6e820bbbd483dafac853f" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/editorconfig-checker/blobs/sha256:448f1ebb1897e6d07f5d6928066339ce01ea89f7e1f6e820bbbd483dafac853f", + "sha256": "448f1ebb1897e6d07f5d6928066339ce01ea89f7e1f6e820bbbd483dafac853f" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/editorconfig-checker/blobs/sha256:448f1ebb1897e6d07f5d6928066339ce01ea89f7e1f6e820bbbd483dafac853f", + "sha256": "448f1ebb1897e6d07f5d6928066339ce01ea89f7e1f6e820bbbd483dafac853f" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/editorconfig-checker/blobs/sha256:e16b0702aa4bbba6586ca67b2ec147fd781c3b480f1df50a68eda6d4eaa090e1", + "sha256": "e16b0702aa4bbba6586ca67b2ec147fd781c3b480f1df50a68eda6d4eaa090e1" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/editorconfig-checker/blobs/sha256:e16b0702aa4bbba6586ca67b2ec147fd781c3b480f1df50a68eda6d4eaa090e1", + "sha256": "e16b0702aa4bbba6586ca67b2ec147fd781c3b480f1df50a68eda6d4eaa090e1" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/editorconfig-checker/blobs/sha256:e16b0702aa4bbba6586ca67b2ec147fd781c3b480f1df50a68eda6d4eaa090e1", + "sha256": "e16b0702aa4bbba6586ca67b2ec147fd781c3b480f1df50a68eda6d4eaa090e1" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/editorconfig-checker/blobs/sha256:bfc53564fea2c9f3fddc605ad05d7e083be27a830ade4236713e8699daeb71be", + "sha256": "bfc53564fea2c9f3fddc605ad05d7e083be27a830ade4236713e8699daeb71be" + } + } + } + }, + "shellcheck": { + "version": "0.10.0", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:ef742b6992cfcdcd7289718ac64b27174e421d29ce3ad9b81e1856349059b117", + "sha256": "ef742b6992cfcdcd7289718ac64b27174e421d29ce3ad9b81e1856349059b117" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:6e60ee03edb09ac5bc852b8eb813849fa654400e21ffb4c746989678172f5a26", + "sha256": "6e60ee03edb09ac5bc852b8eb813849fa654400e21ffb4c746989678172f5a26" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:d5e8407806dbf757e71930ce2cb9b0d23bae286f0c058d9ff246d851dd7aa871", + "sha256": "d5e8407806dbf757e71930ce2cb9b0d23bae286f0c058d9ff246d851dd7aa871" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:b53cf1e5464406ee49743fc2db84850b6d34d3a2098cf729e629b23f9d6dd6e0", + "sha256": "b53cf1e5464406ee49743fc2db84850b6d34d3a2098cf729e629b23f9d6dd6e0" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:15ba88c48a5ae3b08e085791e3c5e514d9d78ce88414c96bd21ed33f29fb4aca", + "sha256": "15ba88c48a5ae3b08e085791e3c5e514d9d78ce88414c96bd21ed33f29fb4aca" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:b3d14cb62e325d0f7221cd24a7fb4533936feae4ed4dce00e8983ec6e55123f8", + "sha256": "b3d14cb62e325d0f7221cd24a7fb4533936feae4ed4dce00e8983ec6e55123f8" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:6d0867f144686a5caa025cb15ecac49286654b78e7b89979a54eedc9a0cc9b6b", + "sha256": "6d0867f144686a5caa025cb15ecac49286654b78e7b89979a54eedc9a0cc9b6b" + } + } + } + }, + "direnv": { + "version": "2.34.0", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:fd210e16bd6764b33cd2e556a7f07ed579453ba19d518ec11de33edcf3c5c2c7", + "sha256": "fd210e16bd6764b33cd2e556a7f07ed579453ba19d518ec11de33edcf3c5c2c7" + }, + "arm64_ventura": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:59af7e0d05a50eda59d60a8c2c67eb0a3491c0650a334568ae13988da3b32951", + "sha256": "59af7e0d05a50eda59d60a8c2c67eb0a3491c0650a334568ae13988da3b32951" + }, + "arm64_monterey": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:2577f8c5e2c3c7d1ee2f6966e3c92a16853edb9302d78089ddfc4f8ef9efda24", + "sha256": "2577f8c5e2c3c7d1ee2f6966e3c92a16853edb9302d78089ddfc4f8ef9efda24" + }, + "sonoma": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:4148bce1352772af61eb44303877e57e54a8531240cb551ec2c879660ac90c54", + "sha256": "4148bce1352772af61eb44303877e57e54a8531240cb551ec2c879660ac90c54" + }, + "ventura": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:b4eefec1b63c6c32713290af5f5e1f2c318d3c64ba052aab786aab0b87c1b437", + "sha256": "b4eefec1b63c6c32713290af5f5e1f2c318d3c64ba052aab786aab0b87c1b437" + }, + "monterey": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:41cadfe20ab1913f07376ac5206ee49c3322ac8689ecd9a5dc85c5146850dff2", + "sha256": "41cadfe20ab1913f07376ac5206ee49c3322ac8689ecd9a5dc85c5146850dff2" + }, + "x86_64_linux": { + "cellar": "/home/linuxbrew/.linuxbrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:be4b933f8f607bf1a705c13abe75d04a99856f1698c3ebcb71e07e469850e964", + "sha256": "be4b933f8f607bf1a705c13abe75d04a99856f1698c3ebcb71e07e469850e964" + } + } + } + }, + "yq": { + "version": "4.44.2", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/yq/blobs/sha256:977679430d5dafca5fcb26f8c0f085ca4d6b0378a8ba6e948a4bf77ac210093d", + "sha256": "977679430d5dafca5fcb26f8c0f085ca4d6b0378a8ba6e948a4bf77ac210093d" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/yq/blobs/sha256:398c8ab340dbff5808bbd4b03b9abe6c6c2898577cd1a01d276bee8750749519", + "sha256": "398c8ab340dbff5808bbd4b03b9abe6c6c2898577cd1a01d276bee8750749519" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/yq/blobs/sha256:308f642333ed2b98edc08cd9949a4be30b68077e4a094cc44388f1a5c42e5e5c", + "sha256": "308f642333ed2b98edc08cd9949a4be30b68077e4a094cc44388f1a5c42e5e5c" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/yq/blobs/sha256:6e5ef90594c34eaff5beb3474d28a12dc593f63695518b2e762ef837323a6ffa", + "sha256": "6e5ef90594c34eaff5beb3474d28a12dc593f63695518b2e762ef837323a6ffa" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/yq/blobs/sha256:1ffca458716ecbce38c8c66758af3dc3b2e365299305ba5c5ce9e5fa604ffd61", + "sha256": "1ffca458716ecbce38c8c66758af3dc3b2e365299305ba5c5ce9e5fa604ffd61" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/yq/blobs/sha256:03059d9e8e1fd024e4dd27d72e82b2f5b38fae67a0d0c0e72d8fd79ac68a337c", + "sha256": "03059d9e8e1fd024e4dd27d72e82b2f5b38fae67a0d0c0e72d8fd79ac68a337c" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/yq/blobs/sha256:03a1e8274841cb3122204e9e637bcf81b393de0efd8cc17a3201dea362a29808", + "sha256": "03a1e8274841cb3122204e9e637bcf81b393de0efd8cc17a3201dea362a29808" + } + } + } + }, + "jq": { + "version": "1.7.1", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:07bc9081c0fdb43aca089e5839f6a270fc45ca9aa7d7633e16fac0fdfe4c4ad8", + "sha256": "07bc9081c0fdb43aca089e5839f6a270fc45ca9aa7d7633e16fac0fdfe4c4ad8" + }, + "arm64_ventura": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:1b27f5277eb2cdfac9f3970ee9adadddc5e04e45469de05a663bc16e793b4eea", + "sha256": "1b27f5277eb2cdfac9f3970ee9adadddc5e04e45469de05a663bc16e793b4eea" + }, + "arm64_monterey": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:41911a73dc6a44c9788c198abc18307213d070d7ca6375e8dd6994335aaee136", + "sha256": "41911a73dc6a44c9788c198abc18307213d070d7ca6375e8dd6994335aaee136" + }, + "sonoma": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:b68d33a5e3c79a0f457d96de1ad1f200c05314f5fea9244d712847c92032b5f7", + "sha256": "b68d33a5e3c79a0f457d96de1ad1f200c05314f5fea9244d712847c92032b5f7" + }, + "ventura": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:10b845b1505892ff585b49e89fe3b09761d148b2c14ca6f5a1aa58002452f8f0", + "sha256": "10b845b1505892ff585b49e89fe3b09761d148b2c14ca6f5a1aa58002452f8f0" + }, + "monterey": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:449c76665ac72b34daeb1a09dd19217e3be1e723c63ec3ac88e02b8c9a750f34", + "sha256": "449c76665ac72b34daeb1a09dd19217e3be1e723c63ec3ac88e02b8c9a750f34" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/jq/blobs/sha256:ed490b627b327b3458a70a78c546be07d57bfc6958921f875b76e85f6be51f47", + "sha256": "ed490b627b327b3458a70a78c546be07d57bfc6958921f875b76e85f6be51f47" + } + } + } + }, + "qemu": { + "version": "8.2.1", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:f311e5fb1680c804cf8ad81cacba4debbcf342286a6b9dcaedd1b63209fe39ec", + "sha256": "f311e5fb1680c804cf8ad81cacba4debbcf342286a6b9dcaedd1b63209fe39ec" + }, + "arm64_ventura": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:bf3da035036c36a50e9159c7e0f1d60cedf30430ab0084c204f43dd2ec85c06c", + "sha256": "bf3da035036c36a50e9159c7e0f1d60cedf30430ab0084c204f43dd2ec85c06c" + }, + "arm64_monterey": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:3423bd27091954d38f38ebbf70fa34732fc2512e38fdb30e46b89f163605d4e1", + "sha256": "3423bd27091954d38f38ebbf70fa34732fc2512e38fdb30e46b89f163605d4e1" + }, + "sonoma": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:0489c70b7a5c85bee85a79b61cbb8310f1e702f8fbbee60f5bcb18494a99c79c", + "sha256": "0489c70b7a5c85bee85a79b61cbb8310f1e702f8fbbee60f5bcb18494a99c79c" + }, + "ventura": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:06af41e06cb08571b33a73822734687445f071df6b94dd3b90ac066cc4a79697", + "sha256": "06af41e06cb08571b33a73822734687445f071df6b94dd3b90ac066cc4a79697" + }, + "monterey": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:41c77f6bac3e8c1664c665fbe2b19b19ee9da57f8e1ad6697348286710cc3575", + "sha256": "41c77f6bac3e8c1664c665fbe2b19b19ee9da57f8e1ad6697348286710cc3575" + }, + "x86_64_linux": { + "cellar": "/home/linuxbrew/.linuxbrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:4675fa42080a52789082176f30b08892e90ec99c5eec3100fbbb6ad978f172ee", + "sha256": "4675fa42080a52789082176f30b08892e90ec99c5eec3100fbbb6ad978f172ee" + } + } + } + } + }, + "vscode": { + "Command is only available in WSL or inside a Visual Studio Code terminal.": null + } + }, + "system": { + "linux": { + "Ubuntu 22.04.1 LTS (jammy)": { + "HOMEBREW_VERSION": "4.3.9", + "HOMEBREW_PREFIX": "/home/linuxbrew/.linuxbrew", + "Homebrew/homebrew-core": "api", + "GCC": "11.3.0" + } + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..6f49a2e --- /dev/null +++ b/README.md @@ -0,0 +1,223 @@ +# elemental-ubuntu + +Ubuntu os derivative build via Rancher [elemental-toolkit](https://github.com/rancher/elemental-toolkit) + +## Getting Started + +Getting started with Elemental + +![](https://github.com/felegy/elemental-ubuntu/assets/1136546/fe41e79c-d69b-4844-aaae-6ec39a9db43c) + + +### Prerequisite + +All dependencies and tooling are in a DevContainer (`./.devcontainer` directory). +- docker is required, +- [vscode](https://code.visualstudio.com/docs/devcontainers/containers) or any developer IDE with [devcontainer support](https://www.augmentedmind.de/2022/10/30/container-based-development-envs) is also needed. + +### Open repo (`[Reopen in Container]`) + +Clone this repo and open in vscode. + +```console +# via https +$ git clone https://github.com/felegy/elemental-ubuntu.git +Cloning into 'elemental-ubuntu'... +... done. + +# or via ssh +$ git clone ssh://git@ssh.github.com:443/felegy/elemental-ubuntu.git +Cloning into 'elemental-ubuntu'... +... done. + +$ cd elemental-ubuntu +$ code . +``` + +And now run devcontainer, click on `[Reopen in Container]` button. + +![Screenshot from 2024-03-19 11-47-55](https://github.com/felegy/elemental-ubuntu/assets/1136546/ff9874ce-9621-49ae-bdfb-322e9fc1a840) + + +### Install Brew dependencies + +The repo contains a Brewfile for easier tooling installation. + +```console +$ brew bundle install +==> Auto-updating Homebrew... +Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with +HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). +Installing from the API is now the default behaviour! +You can save space and time by running: + brew untap homebrew/core +Using homebrew/bundle +Using editorconfig-checker +Using shellcheck +Using direnv +Using yq +Using jq +Using Command is only available in WSL or inside a Visual Studio Code terminal. +Homebrew Bundle complete! 7 Brewfile dependencies now installed. +``` +### Build OS image + +OS Image build is a simple docker build via make, dockerfile: (`./os/ubuntu/Dockerfile`) + +```console +$ make build-os +docker build + --platform linux/x86_64 \ + --build-arg TOOLKIT_REPO=ghcr.io/rancher/elemental-toolkit/elemental-cli \ + --build-arg VERSION=v2.1.0-dev-ga2c4f0b3b \ + --build-arg REPO=ghcr.io/felegy/elemental-ubuntu \ + --tag ghcr.io/felegy/elemental-ubuntu:v0.0.1-gb47b71f \ + os/ubuntu +[+] Building 170.4s (21/21) FINISHED docker:default + => [internal] load build definition from Dockerfile 0.1s + => => transferring dockerfile: 2.82kB 0.0s + => [internal] load .dockerignore 0.1s + => => transferring context: 2B 0.0s + => [internal] load metadata for docker.io/library/ubuntu:23.04 + ... +``` + +When a successful build has finished, you have a docker image like this: + +```console +$ docker images +REPOSITORY TAG IMAGE ID CREATED SIZE +ghcr.io/felegy/elemental-ubuntu v0.0.1-gb47b71f f53d593b2c44 30 seconds ago 2.22GB +``` + +### ISO build + +```console +$ make build-iso +Building x86_64 ISO +mkdir -p /workspaces/elemental-ubuntu/build +docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /workspaces/elemental-ubuntu/build:/build \ + --entrypoint /usr/bin/elemental ghcr.io/rancher/elemental-toolkit/elemental-cli:v2.1.0-dev-ga2c4f0b3b --debug build-iso --bootloader-in-rootfs -n elemental-ubuntu.x86_64 \ + --local --platform linux/x86_64 --squash-no-compression --config-dir=/build -o /build ghcr.io/felegy/elemental-ubuntu:v0.0.1-gb47b71f +DEBU[2024-03-18T16:56:41Z] Starting elemental version v2.1.0-dev on commit a2c4f0b3b0950d559a8fcaaa14972de6d9c68f1a +INFO[2024-03-18T16:56:41Z] Reading configuration from '/build' + +... + +INFO[2024-03-18T16:56:41Z] Preparing squashfs root (1 source)... +INFO[2024-03-18T16:56:41Z] Copying ghcr.io/felegy/elemental-ubuntu:v0.0.1-gb47b71f source... + +... + +INFO[2024-03-18T16:58:00Z] Preparing ISO image root tree... + +... + +INFO[2024-03-18T16:58:00Z] Creating squashfs... + +... + +Drive current: -outdev '/build/elemental-ubuntu.x86_64.iso' +Media current: stdio file, overwriteable +Media status : is blank +Media summary: 0 sessions, 0 data blocks, 0 data, 947g free +xorriso : UPDATE : 16 files added in 1 seconds +Added to ISO image: directory '/'='/tmp/elemental-iso242682882/iso' +xorriso : UPDATE : Writing: 10917s 2.3% fifo 0% buf 50% +xorriso : UPDATE : Writing: 122880s 25.5% fifo 12% buf 50% 165.3xD +xorriso : UPDATE : Writing: 248470s 51.5% fifo 6% buf 50% 185.4xD +xorriso : UPDATE : Writing: 356103s 73.8% fifo 0% buf 50% 158.9xD +ISO image produced: 482497 sectors +Written to medium : 482512 sectors at LBA 48 +Writing to '/build/elemental-ubuntu.x86_64.iso' completed successfully. +``` +When a successful ISO build has finished, you have a bootable iso like this: + +```console +ls -lh build +total 943M +-rw-r--r-- 1 root root 943M Mar 18 16:59 elemental-ubuntu.x86_64.iso +-rw-r--r-- 1 root root 93 Mar 18 16:59 elemental-ubuntu.x86_64.iso.sha256 +-rw-r--r-- 1 vscode vscode 101 Mar 18 15:03 manifest.yaml +``` + +### Booting ISO + +In the above step your ISO file is a bootable UEFI iso image, ideal for a virtual machine (or any) installation purpose. + +Grub: + +![](https://github.com/felegy/elemental-ubuntu/assets/1136546/28e2a66f-8687-45ea-a6c3-99e53290ede9) + +When Live OS has been booted login via `root` and `cos` as password, and now install the system: + +```console +Welcome to Ubuntu 23.04 (GNU/Linux 6.2.0-39-generic x86_64) + + * Documentation: https://help.ubuntu.com + * Management: https://landscape.canonical.com + * Support: https://ubuntu.com/advantage + +This system has been minimized by removing packages and content that are +not required on a system that users do not log into. + +To restore this content, you can run the 'unminimize' command. + +The programs included with the Ubuntu system are free software; +the exact distribution terms for each program are described in the +individual files in /usr/share/doc/*/copyright. + +Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by +applicable law. + +$ elemental install /dev/sda +WARN[0000] Could not read state file /run/initramfs/elemental-state/state.yaml +INFO[2024-03-18T17:21:10Z] Starting elemental version v2.1.0-dev +INFO[2024-03-18T17:21:10Z] Reading configuration from '/etc/elemental' +INFO[2024-03-18T17:21:10Z] Install called +INFO[2024-03-18T17:21:10Z] Partitioning device... +INFO[2024-03-18T17:21:12Z] Mounting disk partitions +INFO[2024-03-18T17:21:13Z] Initiating a LoopDevice snapshotter at /run/elemental/state +INFO[2024-03-18T17:21:13Z] Running before-install hook +INFO[2024-03-18T17:21:13Z] Starting snapshotter transaction +INFO[2024-03-18T17:21:13Z] Starting a snapshotter transaction +INFO[2024-03-18T17:21:13Z] path /run/elemental/state/.snapshots/active does not exist +INFO[2024-03-18T17:21:13Z] Transaction for snapshot 1 successfully started +INFO[2024-03-18T17:21:13Z] Copying /run/rootfsbase source... +INFO[2024-03-18T17:21:13Z] Starting rsync... +INFO[2024-03-18T17:21:46Z] Finished syncing +INFO[2024-03-18T17:21:46Z] Finished copying /run/rootfsbase into /run/elemental/state/.snapshots/1/snapshot.workDir +INFO[2024-03-18T17:21:46Z] Fine tune the dumped root tree +INFO[2024-03-18T17:21:47Z] Entry created for elemental-shim in the EFI boot manager +INFO[2024-03-18T17:21:47Z] Using grub config file /run/elemental/state/.snapshots/1/snapshot.workDir/etc/elemental/grub.cfg +INFO[2024-03-18T17:21:47Z] Copying grub config file from /run/elemental/state/.snapshots/1/snapshot.workDir/etc/elemental/grub.cfg to /run/elemental/efi/EFI/BOOT/grub.cfg +INFO[2024-03-18T17:21:47Z] Using grub config file /run/elemental/state/.snapshots/1/snapshot.workDir/etc/elemental/grub.cfg +INFO[2024-03-18T17:21:47Z] Copying grub config file from /run/elemental/state/.snapshots/1/snapshot.workDir/etc/elemental/grub.cfg to /run/elemental/efi/EFI/ELEMENTAL/grub.cfg +INFO[2024-03-18T17:21:49Z] Running after-install-chroot hook +INFO[2024-03-18T17:21:49Z] Running after-install hook +INFO[2024-03-18T17:21:50Z] Setting default grub entry to Elemental +INFO[2024-03-18T17:21:50Z] Closing snapshotter transaction +INFO[2024-03-18T17:21:50Z] Closing transaction for snapshot 1 workdir +INFO[2024-03-18T17:21:50Z] Creating image /run/elemental/state/.snapshots/1/snapshot.img from rootDir /run/elemental/state/.snapshots/1/snapshot.workDir +INFO[2024-03-18T17:21:51Z] Sync /run/elemental/state/.snapshots/1/snapshot.workDir to /run/elemental/workingtree +INFO[2024-03-18T17:21:51Z] Starting rsync... +INFO[2024-03-18T17:22:20Z] Finished syncing +INFO[2024-03-18T17:22:24Z] Cleaning old passive snapshots +INFO[2024-03-18T17:22:24Z] Setting bootloader with current passive snapshots +INFO[2024-03-18T17:22:25Z] Deploying recovery system +INFO[2024-03-18T17:22:25Z] Deploying image: /run/elemental/recovery/recovery.img +INFO[2024-03-18T17:22:25Z] Creating image /run/elemental/recovery/recovery.img from rootDir /run/elemental/recovery/recovery.imgTree +INFO[2024-03-18T17:22:29Z] Sync /run/elemental/recovery/recovery.imgTree to /run/elemental/transition +INFO[2024-03-18T17:22:29Z] Starting rsync... +INFO[2024-03-18T17:23:22Z] Finished syncing +INFO[2024-03-18T17:23:24Z] Running post-install hook +INFO[2024-03-18T17:23:24Z] Creating installation state files +INFO[2024-03-18T17:23:24Z] Unmounting disk partitions + +$ reboot +``` + +Install finished and the first boot: + +![image](https://github.com/felegy/elemental-ubuntu/assets/1136546/c0a37445-1cd9-4f9e-bc8f-9e7811211427) +