Beginning of usb client builds with user interfaces

This commit is contained in:
Bob Mottram 2016-06-06 17:31:23 +01:00
parent b292d24377
commit ee2dd373ef
No known key found for this signature in database
GPG Key ID: BA68F26108DC9F87
3 changed files with 34 additions and 12 deletions

View File

@ -285,13 +285,6 @@ if [[ $GENERIC_IMAGE == "yes" ]]; then
PASSWORD=$GENERIC_IMAGE_PASSWORD PASSWORD=$GENERIC_IMAGE_PASSWORD
fi fi
# If this is a mesh variant then create an appropriate script
#if [[ $VARIANT == "mesh"* ]]; then
#CONFIG_FILENAME=/tmp/${PROJECT_NAME}_mesh.cfg
#mesh_router_setup_script $CONFIG_FILENAME
#DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}')
#fi
if [ ! $PASSWORD ]; then if [ ! $PASSWORD ]; then
# generate a random password # generate a random password
PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})" PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})"

View File

@ -242,7 +242,7 @@ create_generic_image() {
fi fi
# Don't install any configuration. This will be a base system # Don't install any configuration. This will be a base system
if [[ $VARIANT != "mesh" ]]; then if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" ]]; then
CONFIG_FILENAME= CONFIG_FILENAME=
else else
touch $rootdir/root/.initial_mesh_setup touch $rootdir/root/.initial_mesh_setup
@ -319,7 +319,7 @@ EOF
echo " git pull" >> $rootdir/root/.bashrc echo " git pull" >> $rootdir/root/.bashrc
echo " make install" >> $rootdir/root/.bashrc echo " make install" >> $rootdir/root/.bashrc
if [[ $VARIANT != "mesh" ]]; then if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
if [[ $ONION_ONLY == "no" ]]; then if [[ $ONION_ONLY == "no" ]]; then
if [[ $MINIMAL_INSTALL == "no" ]]; then if [[ $MINIMAL_INSTALL == "no" ]]; then
echo " ${PROJECT_NAME} menuconfig-full" >> $rootdir/root/.bashrc echo " ${PROJECT_NAME} menuconfig-full" >> $rootdir/root/.bashrc
@ -340,7 +340,7 @@ EOF
echo " touch /root/.remove_${GENERIC_IMAGE_USERNAME}" >> $rootdir/root/.bashrc echo " touch /root/.remove_${GENERIC_IMAGE_USERNAME}" >> $rootdir/root/.bashrc
echo ' shred -zu ~/login.txt' >> $rootdir/root/.bashrc echo ' shred -zu ~/login.txt' >> $rootdir/root/.bashrc
END_MESSAGE1=$'Congratulations!' END_MESSAGE1=$'Congratulations!'
if [[ $VARIANT != "mesh" ]]; then if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
END_MESSAGE2=$'\nYour system has now installed\n\nThe onion ssh service is at $SSH_ONION_HOSTNAME\n\nPress any key to reboot and begin using it' END_MESSAGE2=$'\nYour system has now installed\n\nThe onion ssh service is at $SSH_ONION_HOSTNAME\n\nPress any key to reboot and begin using it'
echo ' SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)' >> $rootdir/root/.bashrc echo ' SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)' >> $rootdir/root/.bashrc
else else
@ -400,7 +400,7 @@ atheros_wifi() {
} }
configure_wifi() { configure_wifi() {
if [[ $VARIANT == "mesh" ]]; then if [[ $VARIANT == "mesh" || $VARIANT == "meshclient" ]]; then
return return
fi fi
@ -953,7 +953,10 @@ function mesh_zeronet {
} }
initialise_mesh() { initialise_mesh() {
if [[ $VARIANT != "mesh" || $DEBIAN_INSTALL_ONLY != "no" ]]; then if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" ]]; then
return
fi
if [[ $DEBIAN_INSTALL_ONLY != "no" ]]; then
return return
fi fi
@ -986,6 +989,21 @@ initialise_mesh() {
chroot "$rootdir" systemctl enable $MESH_SERVICE chroot "$rootdir" systemctl enable $MESH_SERVICE
} }
# User interface for USB drive installs ######################################
function configure_user_interface {
if [[ $VARIANT != "meshclient" && $VARIANT != "usb" ]]; then
return
fi
chroot "$rootdir" apt-get -y install mate-desktop-environment
if [[ $VARIANT == "usb" ]]; then
chroot "$rootdir" apt-get -y install tor
# TODO
fi
}
############################################################################## ##############################################################################
@ -1110,6 +1128,7 @@ atheros_wifi
continue_installation continue_installation
initialise_mesh initialise_mesh
configure_wifi configure_wifi
configure_user_interface
cd / cd /
echo $"info: killing leftover processes in chroot" echo $"info: killing leftover processes in chroot"

View File

@ -126,6 +126,16 @@ case "$MACHINE" in
extra_opts="\ extra_opts="\
--grub \ --grub \
--roottype btrfs \ --roottype btrfs \
" ;;
usb)
extra_opts="\
--grub \
--roottype btrfs \
" ;;
meshclient)
extra_opts="\
--grub \
--roottype btrfs \
" ;; " ;;
all) all)
extra_opts="\ extra_opts="\