From 7fd8a8527ae8aa5f29c627df515a14f2f33ff842 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 3 Oct 2023 19:21:12 -0600 Subject: [PATCH] Reworking Debian install with real system. --- repair.sh | 4 ++++ scripts/install_debian_12.sh | 13 +++++++++++-- scripts/install_raspberrypios.sh | 13 +++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/repair.sh b/repair.sh index cf820ea2..1e13d0bb 100755 --- a/repair.sh +++ b/repair.sh @@ -125,3 +125,7 @@ chown wrolpi:wrolpi /media/wrolpi chown -R wrolpi:wrolpi /home/wrolpi /opt/wrolpi* systemctl start wrolpi.target + +set +x + +echo "Repair has completed. You may run /opt/wrolpi/help.sh to check system status." diff --git a/scripts/install_debian_12.sh b/scripts/install_debian_12.sh index d72c5aef..58c23c81 100755 --- a/scripts/install_debian_12.sh +++ b/scripts/install_debian_12.sh @@ -7,7 +7,7 @@ set -e # Update if we haven't updated in the last day. [ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -1)" ] && apt update # Install dependencies. -apt-get install -y < /opt/wrolpi/debian-live-config/config/package-lists/wrolpi.list.chroot +apt-get install -y $(cat /opt/wrolpi/debian-live-config/config/package-lists/wrolpi.list.chroot) # App dependencies were installed. node -v @@ -24,10 +24,19 @@ npm install || npm install || npm install || npm install # try install multiple python3 -m venv /opt/wrolpi/venv /opt/wrolpi/venv/bin/pip3 install -r /opt/wrolpi/requirements.txt +# Create the WROLPi user +grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bash)" + # Get map dependencies. [ -d /opt/openstreetmap-carto ] && chown -R wrolpi:wrolpi /opt/openstreetmap-carto git clone https://github.com/lrnselfreliance/openstreetmap-carto.git /opt/openstreetmap-carto || : -sudo -u _renderd /bin/bash -c '(cd /opt/openstreetmap-carto && git fetch && git checkout master && git reset --hard origin/master && git pull --ff)' +(cd /opt/openstreetmap-carto && git fetch && git checkout master && git reset --hard origin/master && git pull --ff) +chown -R _renderd:_renderd /opt/openstreetmap-carto + +# Get map initialization dump. +if [[ ! -f /opt/wrolpi-blobs/gis-map.dump.gz || ! -s /opt/wrolpi-blobs/gis-map.dump.gz ]]; then + wget https://wrolpi.nyc3.cdn.digitaloceanspaces.com/gis-map.dump.gz -O /opt/wrolpi-blobs/gis-map.dump.gz +fi # Repair will install configs and restart services. /opt/wrolpi/repair.sh diff --git a/scripts/install_raspberrypios.sh b/scripts/install_raspberrypios.sh index 54f863a0..cd05731f 100755 --- a/scripts/install_raspberrypios.sh +++ b/scripts/install_raspberrypios.sh @@ -7,7 +7,7 @@ set -e # Update if we haven't updated in the last day. [ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -1)" ] && apt update # Install dependencies. -apt-get install -y < /opt/wrolpi/pi-gen/stage2/04-wrolpi/01-packages +apt-get install -y $(cat /opt/wrolpi/pi-gen/stage2/04-wrolpi/01-packages) # App dependencies were installed. node -v @@ -24,10 +24,19 @@ npm install || npm install || npm install || npm install # try install multiple python3 -m venv /opt/wrolpi/venv /opt/wrolpi/venv/bin/pip3 install -r /opt/wrolpi/requirements.txt +# Create the WROLPi user +grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bash)" + # Get map dependencies. [ -d /opt/openstreetmap-carto ] && chown -R wrolpi:wrolpi /opt/openstreetmap-carto git clone https://github.com/lrnselfreliance/openstreetmap-carto.git /opt/openstreetmap-carto || : -sudo -u _renderd /bin/bash -c '(cd /opt/openstreetmap-carto && git fetch && git checkout master && git reset --hard origin/master && git pull --ff)' +(cd /opt/openstreetmap-carto && git fetch && git checkout master && git reset --hard origin/master && git pull --ff) +chown -R _renderd:_renderd /opt/openstreetmap-carto + +# Get map initialization dump. +if [[ ! -f /opt/wrolpi-blobs/gis-map.dump.gz || ! -s /opt/wrolpi-blobs/gis-map.dump.gz ]]; then + wget https://wrolpi.nyc3.cdn.digitaloceanspaces.com/gis-map.dump.gz -O /opt/wrolpi-blobs/gis-map.dump.gz +fi # Repair will install configs and restart services. /opt/wrolpi/repair.sh