various fixes
[automated-distro-installer] / fai-redep
index 7dc0d097496e679750ad4437ee5a2acdce5026de..9938c3bd639b22619aa2ebdce6495c853524aca3 100755 (executable)
--- a/fai-redep
+++ b/fai-redep
@@ -1,4 +1,4 @@
-#!/bin/bash -l
+#!/bin/bash
 # Copyright (C) 2016 Ian Kelling
 
 # This program is free software; you can redistribute it and/or
@@ -21,8 +21,9 @@ x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*}
 
 usage() {
     cat <<EOF
-usage: ${0##*/} [-h|--help] [HOST]
+usage: ${0##*/} [-h|--help] [HOST] [DISTRO]
 Deploy fai config (the one in nfs) to HOST or default faiserver
+DISTRO is default this distro, or DISTRO for setting up DESKTOP packages.
 EOF
     exit $1
 }
@@ -45,7 +46,7 @@ scp -q ~/.ssh/home.pub \
     root@$faiserver_host:/srv/fai/config/files/root/.ssh/authorized_keys/GRUB_PC
 # todo: automatically disable faiserver after a period so
 # these files are not exposed.
-s scp -qr /q/root/luks /q/root/shadow \
+sudo scp -qr /q/root/luks /q/root/shadow \
   root@$faiserver_host:/srv/fai/config/distro-install-common
 
 # should tar ssh all the files, but these ones really justified it
@@ -53,6 +54,12 @@ tar -cz /p/c/machine_specific/*/filesystem/etc/ssh | \
   ssh root@$faiserver_host tar -xz -C /srv/fai/config/distro-install-common
 
 
+. /a/bin/distro-setup/pkgs
+pall+=($(/a/bin/buildscripts/emacs -p; /a/bin/distro-setup/distro-pkgs $2))
+{ echo PACKAGES install; echo "${pall[*]}"|sed 's/ /\n/g'; } | \
+  ssh root@$faiserver_host dd of=/srv/fai/config/package_config/DESKTOP 2>/dev/null ||: # broken pipe
+
+
 # built BELENOS basefile with mk-basefile -J BELENOS64. it's stored in
 # it's own repo which is published alongside this one called
 # fai-basefiles due to being a large binary file.