From 6d2d640f64ab2386b11e0eb5400216aeb3125213 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 28 Jul 2017 21:25:24 +0200 Subject: [PATCH] RPi: Move toward generated MotD Fixes arch_rpi_image_prepare#14 --- .gitignore | 1 + Makefile | 15 +++++++++------ .../rpi/motd.txt => rpi.motd-template.txt | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) rename piratebox/piratebox/rpi/motd.txt => rpi.motd-template.txt (94%) diff --git a/.gitignore b/.gitignore index 57eb33e..6b14e74 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ tmp/* piratebox/piratebox/bin/miniircd.py piratebox/piratebox/www/Shared piratebox/piratebox/www/cgi-bin/data.pso +piratebox/piratebox/rpi/motd.txt diff --git a/Makefile b/Makefile index 6282dcb..a73ba74 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) PACKAGE_NAME=$(NAME)_$(VERSION) PACKAGE=$(PACKAGE_NAME).tar.gz VERSION_FILE=$(PB_FOLDER)/$(PB_FOLDER)/version +MOTD=$(PB_FOLDER)/$(PB_FOLDER)/rpi/motd.txt IMAGE_FILE=piratebox_ws_1.1_img.gz TGZ_IMAGE_FILE=piratebox_ws_1.1_img.tar.gz @@ -32,16 +33,18 @@ $(IRC_TARGET_SERVER): git clone $(IRC_GITHUB_ULR) $(IRC_WORK_FOLDER) cp $(IRC_SRC_SERVER) $(IRC_TARGET_SERVER) -$(VERSION): +$(MOTD): + sed -e 's|##version##|$(VERSION)|' rpi.motd-template.txt > $@ + +$(VERSION): echo "$(PACKAGE_NAME)" > $(VERSION_FILE) echo `git status -sb --porcelain` >> $(VERSION_FILE) echo ` git log -1 --oneline` >> $(VERSION_FILE) -$(PACKAGE): $(IRC_TARGET_SERVER) $(VERSION) - tar czf $@ $(PB_FOLDER) +$(PACKAGE): $(IRC_TARGET_SERVER) $(VERSION) $(MOTD) + tar czf $@ $(PB_FOLDER) - -$(IMAGE_FILE): $(IRC_TARGET_SERVER) $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER) +$(IMAGE_FILE): $(IRC_TARGET_SERVER) $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER) $(MOTD) mkdir -p $(MOUNT_POINT) echo "#### Mounting image-file" sudo mount -o loop,rw,sync $(SRC_IMAGE_UNPACKED) $(MOUNT_POINT) @@ -93,7 +96,7 @@ clean: cleanimage rm -fr $(IRC_WORK_FOLDER) rm -f $(IRC_TARGET_SERVER) rm -f $(PACKAGE) - rm -f $(VERSION_FILE) + rm -f $(VERSION_FILE) $(MOTD) cleanimage: - rm -f $(TGZ_IMAGE_FILE) diff --git a/piratebox/piratebox/rpi/motd.txt b/rpi.motd-template.txt similarity index 94% rename from piratebox/piratebox/rpi/motd.txt rename to rpi.motd-template.txt index 626df55..08a72d0 100644 --- a/piratebox/piratebox/rpi/motd.txt +++ b/rpi.motd-template.txt @@ -5,8 +5,8 @@ ____________________.__ __ __________ |____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \ \/ \/ \/ \/ \/ -Website: http://piratebox.cc PirateBox Version: 1.1.3 -Forum: http://forum.piratebox.cc RPi Image Version: 1.1.3-1 +Website: http://piratebox.cc PirateBox Version: ##version## +Forum: http://forum.piratebox.cc Build date: 00-00-0000 IRC: #piratebox irc.freenode.net Be open -- Share freely! First Steps After Flashing