|
|
@@ -10,11 +10,17 @@ set -x |
|
|
|
|
|
|
|
# Set up live username and hostname |
|
|
|
cat >/etc/casper.conf <<"EOF" |
|
|
|
export USERNAME="ubuntu" |
|
|
|
export USERFULLNAME="Live session user" |
|
|
|
export USERNAME="nilm" |
|
|
|
export USERFULLNAME="NILM User" |
|
|
|
export HOST="nilmbuntu" |
|
|
|
export BUILD_SYSTEM="Ubuntu" |
|
|
|
export FLAVOUR="NILMbuntu" |
|
|
|
|
|
|
|
# Do the inital user setup even though UID 1000 already exists. |
|
|
|
# This also needs to be set in /etc/environment, for ubiquity, |
|
|
|
# but we do that in preseed/early_command so that it only shows |
|
|
|
# up in the LiveCD image. |
|
|
|
export OVERRIDE_SYSTEM_USER=true |
|
|
|
EOF |
|
|
|
|
|
|
|
# Set up NILM-specific stuff to get added to /etc/hosts after installation |
|
|
@@ -293,32 +299,13 @@ EOF |
|
|
|
# sudo -i -u nilmdb git clone $GIT/$repo.git git/$repo |
|
|
|
# done |
|
|
|
|
|
|
|
# # build as root, because we need to do that for the install |
|
|
|
# for repo in $REPOS; do |
|
|
|
# make -C /home/nilmdb/git/$repo install |
|
|
|
# done |
|
|
|
# Create NILM user. This should happen after anything that we put in |
|
|
|
# /etc/skel, since files get copied from there. Note that this user |
|
|
|
# is the same as what we have in the preseed file and casper.conf |
|
|
|
adduser --gecos "NILM User" --disabled-password nilm |
|
|
|
|
|
|
|
# # fix up all permissions in git dir, so nilmdb user can play with it later |
|
|
|
# chown -R nilmdb:nilmdb /home/nilmdb/git |
|
|
|
|
|
|
|
# # Create the initial database and streams by running the standalone |
|
|
|
# # server as nilmdb, making the right nilmtool calls, and killing it. |
|
|
|
# sudo -i -u nilmdb nilmdb-server -a 127.0.0.1 -p 18646 -d /home/nilmdb/db & |
|
|
|
# SERVERPID=$! |
|
|
|
# trap "kill -9 $SERVERPID" 0 |
|
|
|
# for i in $(seq 1 120) ; do |
|
|
|
# sleep 1 |
|
|
|
# echo waiting for nilmdb to start $i |
|
|
|
# if nilmtool -u http://127.0.0.1:18646/ info ; then |
|
|
|
# break |
|
|
|
# fi |
|
|
|
# done |
|
|
|
# nilmtool -u http://127.0.0.1:18646/ destroy -R "/data/*" || true |
|
|
|
# nilmtool -u http://127.0.0.1:18646/ create /data/raw uint16_6 |
|
|
|
# nilmtool -u http://127.0.0.1:18646/ create /data/sinefit float32_3 |
|
|
|
# nilmtool -u http://127.0.0.1:18646/ create /data/prep-a float32_8 |
|
|
|
# nilmtool -u http://127.0.0.1:18646/ create /data/prep-b float32_8 |
|
|
|
# nilmtool -u http://127.0.0.1:18646/ create /data/prep-c float32_8 |
|
|
|
# kill $SERVERPID |
|
|
|
# wait |
|
|
|
# trap "" 0 |
|
|
|
# Make sure initramfs was regenerated with casper changes |
|
|
|
update-initramfs |