Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Reboot on takeover install #228

Merged
merged 4 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ do_copy()

if [ "$K3OS_INSTALL_TAKE_OVER" = "true" ]; then
touch ${TARGET}/k3os/system/takeover

if [ "$K3OS_INSTALL_POWER_OFF" = true ] || grep -q 'k3os.install.power_off=true' /proc/cmdline; then
touch ${TARGET}/k3os/system/poweroff
fi
fi
}

Expand Down
8 changes: 7 additions & 1 deletion overlay/libexec/k3os/mode-disk
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ takeover()
rm -f k3os/system/takeover
rm -rf k3os/data
sync
poweroff -f

if [ -e k3os/system/poweroff ]; then
rm -f k3os/system/poweroff
poweroff -f
else
reboot -f
fi
}

setup_mounts
Expand Down
2 changes: 1 addition & 1 deletion package/packer/aws/template-arm64.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"inline":[
"sudo apt-get update -y",
"sudo apt-get install -y dosfstools parted",
"sudo bash -x /tmp/install.sh --takeover --debug --tty ttyS0 --config /tmp/config.yaml --no-format $(findmnt / -o SOURCE -n) \"{{user `iso_url`}}\""
"sudo bash -x /tmp/install.sh --takeover --poweroff --debug --tty ttyS0 --config /tmp/config.yaml --no-format $(findmnt / -o SOURCE -n) \"{{user `iso_url`}}\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion package/packer/aws/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"inline":[
"sudo apt-get update -y",
"sudo apt-get install -y dosfstools parted",
"sudo bash -x /tmp/install.sh --takeover --debug --tty ttyS0 --config /tmp/config.yaml --no-format $(findmnt / -o SOURCE -n) \"{{user `iso_url`}}\""
"sudo bash -x /tmp/install.sh --takeover --poweroff --debug --tty ttyS0 --config /tmp/config.yaml --no-format $(findmnt / -o SOURCE -n) \"{{user `iso_url`}}\""
]
},
{
Expand Down