-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e49c83
commit 9793ab6
Showing
51 changed files
with
293 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Resize the image | ||
|
||
This plugin is used to extend the guest image size to given value from the | ||
environment variable `${GUEST_SIZE}`. | ||
|
||
If `${GUEST_SIZE}` is not specified like below, then this plugin will be skipped. | ||
``` | ||
export GUEST_SIZE=50G | ||
``` |
5 changes: 3 additions & 2 deletions
5
...ter/pre-stage/01-resize-image/host_run.sh → ...ins/01-resize-image/pre-stage/host_run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Motd welcome | ||
|
||
This plugin is used to set the information in `/etc/motd`, which will be displayed after successful login. Users can customize the welcome information by updating the content of `files/etc/motd`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Netplan | ||
|
||
This plugin is used to add network configuration file `netplan.yaml` in the `/etc/netplan/` directory, which will configure the network for the guest image. Users can customize `netplan.yaml` by updating the contents of `files/etc/netplan/netplan.yaml` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# User authkey | ||
|
||
This plugin is used to set the SSH login user and public key using environment variables `${CVM_USER}` and `${CVM_AUTH_KEY}`. | ||
|
||
The default value of `${CVM_USER}` is "cvm", and users can customize it as shown below. | ||
``` | ||
export CVM_USER=<user> | ||
``` | ||
|
||
The `${CVM_AUTH_KEY}` has no default value, users need to set it themselves. If `${CVM_AUTH_KEY}` is not specified like below, this plugin will be skipped. | ||
|
||
``` | ||
export CVM_AUTH_KEY=<ssh public key> | ||
``` |
2 changes: 1 addition & 1 deletion
2
...er/pre-stage/05-readonly-data/clean_up.sh → ...ns/04-user-authkey/post-stage/clean_up.sh
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Readonly data | ||
|
||
This plugin is used to fix some file permissions to read-only. Users can specify the names of files and directories that need to be fixed in the `pre-stage/file_list`. |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
src/cvm-image-rewriter/plugins/05-readonly-data/post-stage/clean_up.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
DIR=$(dirname "$(readlink -f "$0")") | ||
CLD_DIR="$DIR/../cloud-init" | ||
|
||
if [[ -d "$CLD_DIR" ]]; then | ||
rm -rf "$CLD_DIR" | ||
fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/cvm-image-rewriter/plugins/06-install-tdx-guest-kernel/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Install TDX guest kernel | ||
|
||
This plugin is used to install a TDX guest kernel from a given local repository. | ||
|
||
# Prerequisite | ||
|
||
Prepare the local repository and confirm that there are Debian packages related to the TDX kernel in the `/jammy/amd64/` directory of this repository. It is recommended to place this local repository in the `pre-stage/artifacts/` directory. | ||
``` | ||
mkdir -p ./pre-stage/artifacts | ||
mv <your guest repo> ./pre-stage/artifacts/ | ||
``` | ||
|
||
Set `${CVM_TDX_GUEST_REPO}` to the repository absolute path, or this plugin will be skipped. | ||
``` | ||
export CVM_TDX_GUEST_REPO=$(pwd)/pre-stage/artifacts/<your guest repo> | ||
# Or | ||
export CVM_TDX_GUEST_REPO=<your local guest repo> | ||
``` | ||
|
||
|
||
_NOTE: IF the original image is smaller than 1.5G, please set the environment variable GUEST\_SIZE to a larger value, as this will result in the execution of plugin 01._ |
8 changes: 8 additions & 0 deletions
8
src/cvm-image-rewriter/plugins/06-install-tdx-guest-kernel/post-stage/clean_up.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
DIR=$(dirname "$(readlink -f "$0")") | ||
CLD_DIR="$DIR/../cloud-init" | ||
|
||
if [[ -d "$CLD_DIR" ]]; then | ||
rm -rf "$CLD_DIR" | ||
fi |
File renamed without changes.
Oops, something went wrong.