Added ocs' services to add/remove extra volumes. disconnect root fs. #1

This commit is contained in:
Sebastien Rannou 2014-12-19 10:05:36 +01:00
parent d6e1e0c65f
commit 0f6d8ebc25
4 changed files with 33 additions and 1 deletions

View File

@ -48,10 +48,12 @@ RUN mkdir /tmp/build-xnbd \
# Systemd
RUN systemctl disable getty@tty1.service \
&& systemctl enable NetworkManager-wait-online.service \
&& systemctl disable systemd-networkd.service \
&& systemctl enable serial-getty@ttyS0.service \
&& systemctl enable sshd.service \
&& systemctl enable NetworkManager
&& systemctl enable NetworkManager \
&& systemctl enable ntpdate
# Patch rootfs

View File

@ -0,0 +1,10 @@
[Unit]
Description=OCS additional volumes mounter
[Service]
ExecStart=/usr/sbin/oc-add-extra-volumes
ExecStop=/usr/sbin/oc-remove-extra-volumes
Type=forking
[Install]
WantedBy=basic.target

View File

@ -0,0 +1,10 @@
[Unit]
Description=OCS fetch ssh keys from metadata
After=NetworkManager-wait-online.service
[Service]
ExecStart=/bin/bash -c "mkdir -p /root/.ssh/ ; chmod 700 /root/.ssh ; /usr/local/bin/oc-metadata | grep SSH_PUBLIC_KEYS_.*_KEY | cut -d'=' -f 2- | tr -d \\' > /root/.ssh/authorized_keys"
Type=oneshot
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,10 @@
[Unit]
Description=OCS fetch kernel modules from OCS mirror
After=NetworkManager-wait-online.service
[Service]
ExecStart=/usr/sbin/oc-sync-kernel-modules
Type=oneshot
[Install]
WantedBy=multi-user.target