-
Notifications
You must be signed in to change notification settings - Fork 184
qemu-secex: improve localbuild #3927
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
Changes from all commits
eab4fde
f15c4f5
b437efd
cc0d950
979c3f4
4cdb9b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -3,8 +3,6 @@ version: 1.5.0 | |||||||
passwd: | ||||||||
users: | ||||||||
- name: core | ||||||||
ssh_authorized_keys_local: | ||||||||
- id_rsa.pub | ||||||||
groups: | ||||||||
- wheel | ||||||||
storage: | ||||||||
|
@@ -15,14 +13,14 @@ storage: | |||||||
- path: /etc/se-hostkeys/ibm-z-hostkey-1 | ||||||||
overwrite: true | ||||||||
contents: | ||||||||
local: secex-hostkey | ||||||||
- path: /etc/do_genprotimg | ||||||||
local: HOSTKEY-FILE | ||||||||
- path: /usr/local/bin/do_genprotimg | ||||||||
overwrite: true | ||||||||
mode: 0755 | ||||||||
contents: | ||||||||
dustymabe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
inline: | | ||||||||
#!/bin/bash | ||||||||
set -euo pipefail | ||||||||
set -xeuo pipefail | ||||||||
trap "rm -f /var/genprotimg/signal.file" EXIT | ||||||||
bash /var/build/genprotimg-script.sh & | ||||||||
while [ ! -e "/var/genprotimg/signal.file" ]; do | ||||||||
|
@@ -31,6 +29,34 @@ storage: | |||||||
genprotimg -V --no-verify -i /var/genprotimg/vmlinuz -r /var/genprotimg/initrd.img -p /var/genprotimg/parmfile -k /etc/se-hostkeys/ibm-z-hostkey-1 -o /var/genprotimg/se.img | ||||||||
rm -f /var/genprotimg/signal.file | ||||||||
bash /var/build/post-script.sh | ||||||||
- path: /etc/systemd/system-generators/coreos-genprotimg-generator | ||||||||
overwrite: true | ||||||||
mode: 0755 | ||||||||
contents: | ||||||||
inline: | | ||||||||
#!/bin/bash | ||||||||
export PATH="/usr/bin:/usr/sbin:${PATH}" | ||||||||
set -euo pipefail | ||||||||
. /usr/lib/coreos/generator-lib.sh | ||||||||
if [ ! -z $(karg ignition.firstboot) ]; then | ||||||||
exit 0 | ||||||||
fi | ||||||||
nikita-dubrovskii marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
mkdir -p "${UNIT_DIR}/default.target.wants" | ||||||||
|
||||||||
cat > "${UNIT_DIR}"/var-build.mount << 'EOF' | ||||||||
# generated by coreos-genprotimg-generator | ||||||||
# Mounts partition with parmfile, pre- and post- scripts used by genprotimg.service | ||||||||
[Unit] | ||||||||
Description=Genprotimg partition mount | ||||||||
Requires=dev-disk-by\x2did-virtio\x2dgenprotimg.device | ||||||||
After=dev-disk-by\x2did-virtio\x2dgenprotimg.device | ||||||||
[Mount] | ||||||||
What=/dev/disk/by-id/virtio-genprotimg | ||||||||
Where=/var/build | ||||||||
Type=ext4 | ||||||||
Options=rw,noatime | ||||||||
EOF | ||||||||
ln -sf "../var-build.mount" "${UNIT_DIR}/default.target.wants/" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional/wondering: I'm guessing it wouldn't work to put this unit also in the systemd section of the butane along with genprotimg.service, but with both of them enabled false and then here we just
Suggested change
and thats pretty much all the generator does. |
||||||||
systemd: | ||||||||
units: | ||||||||
- name: [email protected] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. feel free to delete this if you want.. in my earlier code review comment I was just saying that if we do delete it lets put it in a separate commit with a reason even if that reason is "make it more like the ubuntu VM that is used to generate secex artifacts". |
||||||||
|
@@ -48,28 +74,26 @@ systemd: | |||||||
enabled: true | ||||||||
contents: | | ||||||||
[Unit] | ||||||||
Description=GenProtImg | ||||||||
Description=Creates sdboot image on 'se' labeled partition of qemu-secex qcow2 image | ||||||||
ConditionKernelCommandLine=!ignition.firstboot | ||||||||
After=var-build.mount | ||||||||
[Service] | ||||||||
Type=oneshot | ||||||||
StandardOutput=journal+console | ||||||||
ExecStart=/etc/do_genprotimg | ||||||||
ExecStopPost=/sbin/halt | ||||||||
ExecStart=/usr/local/bin/do_genprotimg | ||||||||
ExecStartPost=/usr/bin/systemctl --no-block poweroff | ||||||||
[Install] | ||||||||
WantedBy=default.target | ||||||||
- name: var-build.mount | ||||||||
- name: autohalt.service | ||||||||
nikita-dubrovskii marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
enabled: true | ||||||||
contents: | | ||||||||
[Unit] | ||||||||
Description=Mounts genprotimg build partition | ||||||||
ConditionKernelCommandLine=!ignition.firstboot | ||||||||
Requires=dev-disk-by\x2did-virtio\x2dgenprotimg.device | ||||||||
After=dev-disk-by\x2did-virtio\x2dgenprotimg.device | ||||||||
[Mount] | ||||||||
What=/dev/disk/by-id/virtio-genprotimg | ||||||||
Where=/var/build | ||||||||
Type=ext4 | ||||||||
Options=rw,noatime | ||||||||
Description=Halts system on firstboot | ||||||||
ConditionKernelCommandLine=ignition.firstboot | ||||||||
After=multi-user.target | ||||||||
[Service] | ||||||||
Type=oneshot | ||||||||
ExecStartPre=/bin/echo "Shutting down" | ||||||||
ExecStart=/usr/bin/systemctl --no-block poweroff | ||||||||
[Install] | ||||||||
WantedBy=default.target | ||||||||
WantedBy=multi-user.target |
Uh oh!
There was an error while loading. Please reload this page.