Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs #13

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9318a29
multistrap build variant
thir820 Oct 16, 2024
cd4a302
debootstrap and multistrap
thir820 Oct 16, 2024
cb932f6
fix formatter issue
thir820 Oct 17, 2024
c967059
fix multistrap
thir820 Oct 17, 2024
78246df
fix root test
thir820 Oct 17, 2024
b824439
delete man pages
tomirgang Oct 17, 2024
ec3b1c6
remove duplicate cleanup
tomirgang Oct 17, 2024
43d9450
fix cleanup
tomirgang Oct 17, 2024
c8a3d56
fix error handling
tomirgang Oct 17, 2024
cd89e56
add mandatory packages
tomirgang Oct 17, 2024
c28c539
add mandatory package apt-utils
tomirgang Oct 17, 2024
89f2aae
multistrap: install base-passwd
tomirgang Oct 17, 2024
52476d8
multistrap: fix base-passwd
tomirgang Oct 17, 2024
dff8056
remove multistrap
tomirgang Oct 17, 2024
6f0a6af
fix root test
tomirgang Oct 17, 2024
8f62c83
fix initrd robot test
tomirgang Oct 17, 2024
01885c1
fix initrd.yaml and improve root unit-test
tomirgang Oct 18, 2024
eb8b3a2
fix config test
tomirgang Oct 18, 2024
524813f
fix config test
tomirgang Oct 18, 2024
f597c15
use dev container
tomirgang Oct 18, 2024
a1957e5
fix dev container
tomirgang Oct 18, 2024
af10560
fix root generator
tomirgang Oct 18, 2024
e474e80
fix container download
tomirgang Oct 18, 2024
bc2f363
fix root get config
tomirgang Oct 18, 2024
9163684
minor fixes
tomirgang Oct 18, 2024
0a0a272
set root password and hostname
tomirgang Oct 19, 2024
cc344fe
fix set root and hostname
tomirgang Oct 19, 2024
7a374f5
fix chroot
tomirgang Oct 19, 2024
895952b
fix chroot
tomirgang Oct 19, 2024
ea6dea3
fix kiwi image name
tomirgang Oct 20, 2024
0dcf9c3
fix kiwi
tomirgang Oct 20, 2024
9087caf
start mdbook documentation
tomirgang Oct 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 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": "EB corbos Linux build tools",
"image": "linux.elektrobit.com/ebcl/sdk:v1.3.8",
// This script will get the container and tag it with the local container tag.
"initializeCommand": "${PWD}/init_workspace",
"postCreateCommand": "${PWD}/setup_workspace",
"postStartCommand": "${PWD}/install_extensions",
"customizations": {
"vscode": {
"settings": {
"cmake.options.statusBarVisibility": "visible",
"cmake.configureOnOpen": false
},
"extensions": [
"ms-vscode.cpptools-extension-pack@1.3.0",
"spmeesseman.vscode-taskexplorer@2.9.1"
]
}
},
"remoteUser": "ebcl",
// Required for mount operations.
"privileged": true,
"mounts": [
// SSH Keys
"type=bind,source=/home/${localEnv:USER}/.ssh,target=/home/ebcl/.ssh,readonly",
// Bind-mount the /dev folder, to get access to losetup devices
"type=bind,source=/dev,target=/dev"
],
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
"workspaceFolder": "/workspace"
}
65 changes: 65 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Sample workflow for building and deploying a mdBook site to GitHub Pages
#
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html
#
name: Deploy mdBook site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.37
MDBOOK_IMAGE_SIZE_VERSION: 0.1.0
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
cargo install --version ${MDBOOK_VERSION} mdbook
- name: Install mdbook-image-size
run: |
cargo install --version ${MDBOOK_IMAGE_SIZE_VERSION} mdbook-image-size
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with mdBook
run: mdbook build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./book

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ pytest_report.html

assets/

/tmp


15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# EBcL build helpers

## Run unit tests
## How to develop?

```bash
pytest --html=pytest_report.html
```
Some commands are executed using sudo.
This requires allowing sudo w/o password which is a bad idea on your dev host.
To workaorund this, a dev container is used.

- Open the dev container.

If you don't use the dev container, consider to run:

- Setup Python venv and install required tools: `setup_workspace`
- Install extensions: `install_extensions`
28 changes: 28 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[book]
authors = ["Elektrobit Automotive GmbH"]
description = "EB corbos Linux build tools."
language = "en"
multilingual = false
src = "docs"
title = "EB corbos Linux build tools"

[build]
create-missing = true

[preprocessor.image-size]
command = "mdbook-image-size"

[output.html]
additional-css = ["docs/custom.css"]
curly-quotes = true
mathjax-support = false
copy-fonts = true
git-repository-url = "https://github.com/Elektrobit/ebcl_dev_container/"
git-repository-icon = "fa-github"
edit-url-template = "https://github.com/Elektrobit/ebcl_dev_container/edit/main/{path}"
input-404 = "not-found.md"

[output.html.print]
enable = true
page-break = true

3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# EB corbos Linux build tools

![Elektrobit](assets/logo.png =300x)
5 changes: 5 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Summary

[EB corbos Linux build tools](README.md)

- [Overview](overview.md)
23 changes: 23 additions & 0 deletions docs/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
img {
display: block;
margin-left: auto;
margin-right: auto;
}

h1 {
text-align: center;
}

.chapter:before{
content: '';
background:url('/assets/logo.png');
background-size: 120px;
width: 120px;
height: 120px;
margin-left: 30px;
display: block;
}

a {
color: green !important;
}
5 changes: 5 additions & 0 deletions docs/not-found.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Not found!

This page doesn't exist.

![Elektrobit](/assets/logo.png)
2 changes: 2 additions & 0 deletions docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Overview

2 changes: 1 addition & 1 deletion ebcl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.1"
__version__ = "1.2.0"
2 changes: 1 addition & 1 deletion ebcl/common/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def ebcl_apt(cls, arch: CpuArch, release: str = '1.2'):
key = os.environ.get(
'EBCL_REPO_KEY', 'file:///build/keys/elektrobit.pub')
gpg = os.environ.get(
'EBCL_REPO_GPG', '/etc/berrymill/keyrings.d/elektrobit.gpg')
'EBCL_REPO_GPG', '/etc/apt/trusted.gpg.d/elektrobit.gpg')
return cls(
url=f'{url}/{release}',
distro='ebcl',
Expand Down
2 changes: 1 addition & 1 deletion ebcl/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self, config_file: str, output_path: str):
# Kiwi-ng image version string
self.image_version: Optional[str] = None
# Root filesystem build type.
self.type: BuildType = BuildType.ELBE
self.type: BuildType = BuildType.DEBOOTSTRAP
# Primary repo for debootstrap
self.primary_repo: Optional[str] = None
# Primary repo for debootstrap
Expand Down
7 changes: 4 additions & 3 deletions ebcl/common/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ def copy_file(

is_dir = os.path.isdir(file)
if is_dir:
logging.debug('File %s is a dir...')
logging.debug('File %s is a dir...', file)
else:
logging.debug('File %s is a file...')
logging.debug('File %s is a file...', file)

if delete_if_exists and not is_dir:
self._run_cmd(f'rm -rf {target}', environment)
Expand Down Expand Up @@ -388,7 +388,8 @@ def pack_root_as_tarball(
logging.info('Archive %s exists. Deleting old archive.', archive)
fn_run(f'rm -f {archive}', check=False)

self.fake.run_cmd(f'mv {tmp_archive} {archive}')
self.fake.run_cmd(f'cp {tmp_archive} {archive}')
self.fake.run_cmd(f'rm {tmp_archive}', check=False)

return archive

Expand Down
5 changes: 5 additions & 0 deletions ebcl/common/types/build_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class BuildType(Enum):
""" Build type for the root filesystem build. """
ELBE = 1
KIWI = 2
DEBOOTSTRAP = 3

@classmethod
def from_str(cls, build_type: Optional[str]):
Expand All @@ -21,6 +22,8 @@ def from_str(cls, build_type: Optional[str]):
return cls.ELBE
elif build_type == 'kiwi':
return cls.KIWI
elif build_type == 'debootstrap':
return cls.DEBOOTSTRAP
else:
return None

Expand All @@ -29,5 +32,7 @@ def __str__(self) -> str:
return "elbe"
elif self.value == 2:
return "kiwi-ng"
elif self.value == 3:
return "debootstrap"
else:
return "UNKNOWN"
Loading
Loading