Skip to content

Instantly share code, notes, and snippets.

@bartoszek
Forked from zellio/gentrusty.sh
Last active November 25, 2018 13:54
Show Gist options
  • Save bartoszek/c2469ccde084297b575a06296a886766 to your computer and use it in GitHub Desktop.
Save bartoszek/c2469ccde084297b575a06296a886766 to your computer and use it in GitHub Desktop.
Generate Ubuntu Trusty container that will boot under systemd-nspawn
#!/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
}
__main "$@"
exit "$!"
@bartoszek
Copy link
Author

remove /etc/shadow patch - no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment