-
-
Save simonft/ee9ba5f0dfa392ebe896 to your computer and use it in GitHub Desktop.
Generate Ubuntu Trusty container that will boot under systemd-nspawn
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
#!/usr/bin/env bash | |
function __main | |
{ | |
local -r path="$(realpath "${1:-.}")" | |
debootstrap --variant=buildd trusty "$1" http://archive.ubuntu.com/ubuntu/ | |
patch --unified "$path/etc/init/console.conf" <<'EOF' | |
@@ -3,7 +3,8 @@ | |
# This service maintains a getty on console from the point the system is | |
# started until it is shut down again. | |
-start on stopped rc RUNLEVEL=[2345] and container CONTAINER=lxc | |
+start on stopped rc RUNLEVEL=[2345] and (container CONTAINER=lxc or | |
+ container CONTAINER=systemd-nspawn) | |
stop on runlevel [!2345] | |
EOF | |
path --unified "$path/etc/shadow" <<'EOF' | |
@@ -1,4 +1,4 @@ | |
-root:*:16730:0:99999:7::: | |
+root::16730:0:99999:7::: | |
daemon:*:16730:0:99999:7::: | |
bin:*:16730:0:99999:7::: | |
sys:*:16730:0:99999:7::: | |
EOF | |
} | |
__main "$@" | |
exit "$!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment