Skip to content

Commit f59e330

Browse files
Add os-release file:
This allows us to know at runtime the version of HookOS. Also, modified the prompt to contain the version so that when sharing screenshots to debug it will be clear the Hook version. Turned down the kernel.printk log level to warning (4) so that the console getty doesn't get messy with kernel messages. Better UX (hopefully). A side affect of this is that we won't see messages anymore on the console for when workflow action containers run. Syslog messages will still be sent to Boots. Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
1 parent c9d440e commit f59e330

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@ dev: dbg-image-$(ARCH) ## Build debug mode boot files and container images for c
2929
images: ## Build release mode boot files for all supported architectures
3030
push: push-hook-bootkit push-hook-docker ## Push container images to registry
3131
run: run-$(ARCH) ## Boot system using qemu
32+
33+
.PHONY: update-os-release
34+
update-os-release: ## Update the os-release file versions
35+
## NEW_VERSION should be set from a variable passed to the make command
36+
## e.g. `make update-os-release NEW_VERSION=0.1.0`
37+
for elem in VERSION VERSION_ID; do
38+
sed -i "s/$${elem}=".*"/$${elem}="${NEW_VERSION}"/" hook.yaml
39+
done
40+
sed -i 's/PRETTY_NAME="HookOS .*"/PRETTY_NAME="HookOS ${NEW_VERSION}"/' hook.yaml

RELEASING.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Releasing
22

3-
## Process
4-
53
For version v0.x.y:
64

5+
## Prerequisites
6+
7+
1. Update the `VERSION`, `VERSION_ID`, and `PRETTY_NAME` values in the `hook.yaml` file under `files -> "- path: etc/os-release"` to use `0.x.y`. This can be done with:
8+
9+
```bash
10+
make update-os-release NEW_VERSION=0.x.y
11+
```
12+
13+
1. Commit, push, PR, and merge the version changes
14+
- `git commit -sm "Update version to v0.x.y" hook.yaml`
15+
16+
## Release Process
17+
718
1. Create the annotated tag
819
> NOTE: To use your GPG signature when pushing the tag, use `SIGN_TAG=1 ./contrib/tag-release.sh v0.x.y` instead
920
- `./contrib/tag-release.sh v0.x.y`

hook.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
binds.add:
2929
- /etc/profile.d/local.sh:/etc/profile.d/local.sh
3030
- /etc/motd:/etc/motd
31+
- /etc/os-release:/etc/os-release
3132
env:
3233
- INSECURE=true
3334

@@ -96,23 +97,38 @@ files:
9697
contents: |
9798
alias docker='ctr -n services.linuxkit tasks exec --tty --exec-id cmd hook-docker docker'
9899
alias docker-shell='ctr -n services.linuxkit tasks exec --tty --exec-id shell hook-docker sh'
100+
name_version=$(grep PRETTY_NAME= /etc/os-release | cut -d'=' -f2 | tr -d '"')
101+
export PS1='${name_version}:\w\$ '
102+
# Disable kernel messages on console
103+
echo 4 > /proc/sys/kernel/printk
99104
mode: "0644"
100105

101106
- path: etc/motd
102107
mode: "0644"
108+
# This is ANSI Regular font
103109
contents: |
104110
Welcome to HookOS! Your Tinkerbell operating system installation environment.
105111
106-
██ ██ ██████ ██████ ██ ██ ██████ ███████
107-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
112+
██ ██ ██ ██████ ███████
113+
██ ██ ██████ ██████ ██ ██ ██ ██ ██
108114
███████ ██ ██ ██ ██ █████ ██ ██ ███████
109115
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
110116
██ ██ ██████ ██████ ██ ██ ██████ ███████
111117
112-
- Press `enter` to get a prompt.
113118
- Use `docker` commands to access the tink worker/agent container and workflow action containers.
114119
- Logs are located in the `/var/log/` directory.
115120
121+
- path: etc/os-release
122+
mode: "0444"
123+
contents: |
124+
NAME="HookOS"
125+
VERSION=0.8.1
126+
ID=hookos
127+
VERSION_ID=0.8.1
128+
PRETTY_NAME="HookOS 0.8.1"
129+
ANSI_COLOR="1;34"
130+
HOME_URL="https://github.com/tinkerbell/hook"
131+
116132
- path: etc/ip/vlan.sh
117133
source: "files/vlan.sh"
118134
mode: "0777"

0 commit comments

Comments
 (0)