]> git.plutz.net Git - blast/blobdiff - modules/default.mk
unified bootloader targets, root key setup, webui mode, modules for live boot (lokfs...
[blast] / modules / default.mk
index 47f958b8b69f72883d79389bae391b8d78bc4e9c..2f5364b57d0546e1abe9bf60481dd70717923936 100644 (file)
@@ -13,6 +13,7 @@ export DEBCONF
 define DEBCONF :=
 keyboard-configuration keyboard-configuration/model    select  Generic 105-key (Intl) PC
 keyboard-configuration keyboard-configuration/variant  select  English (US) - English (Macintosh)
+
 endef
 
 .PHONY: _debconf_selections
@@ -51,6 +52,11 @@ ifdef rootpass
   _config: _rootpass
 endif
 
+ifdef rootkey
+  export rootkey
+  _config: _rootkey
+endif
+
 ifdef users
   _config: _users
 endif
@@ -63,6 +69,13 @@ endif
 _rootpass: ${CFGROOT}
        chroot "$${CFGROOT}" usermod -p "$$(openssl passwd "$${rootpass}")" root
 
+${rootkey}.pub:
+       ssh-keygen -N '' -f "$${rootkey}"
+
+_rootkey: ${CFGROOT} ${rootkey}.pub
+       mkdir -m 700 "$${CFGROOT}/root/.ssh/"
+       cp "$${rootkey}.pub" "$${CFGROOT}/root/.ssh/authorized_keys"
+
 _users: ${CFGROOT}
        for u in $(subst ${comma_},${space_},${users}); do \
                chroot "$${CFGROOT}" useradd -m -s /bin/bash -p "$$(openssl passwd "")" "$$u"; \