10-24 image scripts

Tested working for me.
This commit is contained in:
Richard Goodwin
2018-10-24 08:31:16 -05:00
parent a373751033
commit 1bcca1b8dd
3 changed files with 43 additions and 37 deletions

View File

@@ -88,7 +88,7 @@ function check_available_space () {
}
# function get_ancillary_setup_scripts () {
# pushd /tmp
# pushd
# wget https://raw.githubusercontent.com/"$REPO"/teslausb/"$BRANCH"/windows_archive/create-backingfiles-partition.sh
# chmod +x ./create-backingfiles-partition.sh
# wget https://raw.githubusercontent.com/"$REPO"/teslausb/"$BRANCH"/windows_archive/create-backingfiles.sh
@@ -111,20 +111,20 @@ BACKINGFILES_MOUNTPOINT=/backingfiles
function create_usb_drive_backing_files () {
mkdir "$BACKINGFILES_MOUNTPOINT"
/tmp/create-backingfiles-partition.sh "$BACKINGFILES_MOUNTPOINT"
/root/bin/tmp/create-backingfiles-partition.sh "$BACKINGFILES_MOUNTPOINT"
setup_log "Mounting the partition for the backing files..."
mount /backingfiles
setup_log "Mounted the partition for the backing files."
/tmp/create-backingfiles.sh "$campercent" "$BACKINGFILES_MOUNTPOINT"
/root/bin/tmp/create-backingfiles.sh "$campercent" "$BACKINGFILES_MOUNTPOINT"
}
function configure_archive () {
setup_log "Configuring the archive..."
mkdir /mnt/archive
local archive_server_ip_address="$(ping -c 1 -w 1 $archiveserver 2>/dev/null | head -n 1 | grep -o -e "(\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\})" | tr -d '()')"
echo "//$archive_server_ip_address/$sharename /mnt/archive cifs vers=3,credentials=/root/.teslaCamArchiveCredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0" >> /etc/fstab
echo "//$archive_server_ip_address/$sharename /mnt/archive cifs credentials=/root/.teslaCamArchiveCredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0" >> /etc/fstab
echo "username=$shareuser" > /root/.teslaCamArchiveCredentials
echo "password=$sharepassword" >> /root/.teslaCamArchiveCredentials
@@ -189,20 +189,20 @@ EOF
setup_log "Configured rc.local."
}
function configure_hostname () {
setup_log "Configuring the hostname..."
# function configure_hostname () {
# setup_log "Configuring the hostname..."
local new_host_name="teslausb"
cp /etc/hosts ~
sed "s/raspberrypi/$new_host_name/g" ~/hosts > /etc/hosts
# local new_host_name="teslausb"
# cp /etc/hosts ~
# sed "s/raspberrypi/$new_host_name/g" ~/hosts > /etc/hosts
cp /etc/hostname ~
sed "s/raspberrypi/$new_host_name/g" ~/hostname > /etc/hostname
setup_log "Configured the hostname."
}
# cp /etc/hostname ~
# sed "s/raspberrypi/$new_host_name/g" ~/hostname > /etc/hostname
# setup_log "Configured the hostname."
# }
function make_root_fs_readonly () {
/tmp/make-root-fs-readonly.sh
/root/bin/tmp/make-root-fs-readonly.sh
}
# TURN OFF LED so we can start watching progress
@@ -214,13 +214,13 @@ sleep 5
/etc/stage_flash 1
setup_log "SETUP STAGE 1: Check variables file."
if [ ! -e /boot/teslausb_setup_variables.conf ]
then
setup_log "ERROR: teslausb_setup_variables.conf file not found. Can't continue setup."
/etc/stage_flash 10
exit 1
fi
# setup_log "SETUP STAGE 1: Check variables file."
# if [ ! -e /boot/teslausb_setup_variables.conf ]
# then
# setup_log "ERROR: teslausb_setup_variables.conf file not found. Can't continue setup."
# /etc/stage_flash 10
# exit 1
# fi
source /boot/teslausb_setup_variables.conf
@@ -267,7 +267,7 @@ configure_archive
configure_rc_local
configure_hostname
# configure_hostname
# SETUP STAGE 5 and reboot
# If you see 5 flashes we are probably good!