-
Notifications
You must be signed in to change notification settings - Fork 11
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
Showing
16 changed files
with
146 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
local boot_template = import 'boot/main.libsonnet'; | ||
local cs_template = import 'cs/main.libsonnet'; | ||
local ss_template = import 'ss/main.libsonnet'; | ||
local ss2_template = import 'ss2/main.libsonnet'; | ||
local utility = import '../utility.libsonnet'; | ||
function(settings) | ||
utility.prefix_file_names('boot', boot_template(settings)) + | ||
utility.prefix_file_names('cs', cs_template(settings)) + | ||
utility.prefix_file_names('ss', ss_template(settings)) | ||
utility.prefix_file_names('ss', ss_template(settings)) + | ||
utility.prefix_file_names('ss2', ss2_template(settings)) |
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,5 @@ | ||
local config_template = import '../../config.libsonnet'; | ||
local utility = import '../../utility.libsonnet'; | ||
|
||
function(settings) | ||
utility.union_map(std.map(function(x) { [if x=="base" then 'site.yml' else 'site-'+x +'.yml']: config_template(settings.ss2[x]) }, utility.get_ss2(settings))) |
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,37 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_NAME=$(basename $0) | ||
NAME=$1 | ||
UUID=$2 | ||
|
||
output_log() { | ||
logger "$SCRIPT_NAME $NAME $1" | ||
} | ||
|
||
CRYPT_DEV=$(dmsetup deps -u $UUID -o devname | sed -e 's/.*(\(.*\))/\1/') | ||
UDEV_LINKS=$(udevadm info -q symlink -n /dev/$CRYPT_DEV) | ||
|
||
output_log "CRYPT_DEV: $CRYPT_DEV DISK_DEV:$DISK_DEV" | ||
output_log "UDEV_LINKS:$UDEV_LINKS" | ||
|
||
for symlink in $UDEV_LINKS; do | ||
case ${symlink} in | ||
disk/by-path/virtio-*) | ||
;; | ||
disk/by-path/*-ata-*) | ||
;; | ||
disk/by-path/*) | ||
output_log "find a symlink:$symlink" | ||
CRYPT_BASE_PATH=${symlink#disk/by-path/} | ||
;; | ||
esac | ||
done | ||
|
||
if [ -z "$CRYPT_BASE_PATH" ]; then | ||
output_log "could not find symlinks" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p /dev/crypt-disk/by-path/ | ||
echo "CRYPT_BASE_PATH=$CRYPT_BASE_PATH" | ||
exit 0 |
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 @@ | ||
KERNEL!="dm-*", GOTO="neco_end" | ||
ENV{DM_NAME}!="crypt-*", GOTO="neco_end" | ||
# Skip the qemu's system disks | ||
ENV{DM_NAME}=="crypt-vda|crypt-vdb|crypt-vdc", GOTO="neco_end" | ||
|
||
IMPORT{program}="/etc/udev/crypt-base-path $name $env{DM_UUID}", SYMLINK+="crypt-disk/by-path/$env{CRYPT_BASE_PATH}" | ||
|
||
LABEL="neco_end" |
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,5 @@ | ||
# This file is automatically generated from a template. Please do not edit. | ||
include: ../../common/common-gcp0.yml | ||
files: | ||
- /etc/udev/crypt-base-path | ||
- /etc/udev/rules.d/99-neco.rules |
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,5 @@ | ||
# This file is automatically generated from a template. Please do not edit. | ||
include: ../../common/common-stage0.yml | ||
files: | ||
- /etc/udev/crypt-base-path | ||
- /etc/udev/rules.d/99-neco.rules |
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,5 @@ | ||
# This file is automatically generated from a template. Please do not edit. | ||
include: ../../common/common-stage1.yml | ||
files: | ||
- /etc/udev/crypt-base-path | ||
- /etc/udev/rules.d/99-neco.rules |
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,5 @@ | ||
# This file is automatically generated from a template. Please do not edit. | ||
include: ../../common/common.yml | ||
files: | ||
- /etc/udev/crypt-base-path | ||
- /etc/udev/rules.d/99-neco.rules |
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