All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] swupdate: customization of default website path
@ 2016-06-22 21:01 Jordan Yelloz
  2016-06-22 21:01 ` [Buildroot] [PATCH 1/2] swupdate: allowed website install path Jordan Yelloz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jordan Yelloz @ 2016-06-22 21:01 UTC (permalink / raw)
  To: buildroot

This patch allows for customization of the destination directory of the
swupdate default webserver static files. Some configurations use a read-only
rootfs and have a tmpfs mounted on /var so /var/www/swupdate is not an option
for those systems. The newly added option allows users to install the website
files in somewhere more stable like a subdirectory of /usr/share/swupdate or
/usr/share/factory in the case of a volatile /var.

The previous fixed value of /var/www/swupdate is preserved as the default so
this change shouldn't disturb any existing configurations.

Jordan Yelloz (2):
  swupdate: allowed website install path
  swupdate: updated help of INSTALL_WEBSITE config

 package/swupdate/Config.in   | 22 ++++++++++++++++++----
 package/swupdate/swupdate.mk | 11 ++++++++---
 2 files changed, 26 insertions(+), 7 deletions(-)

-- 
2.9.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] swupdate: allowed website install path
  2016-06-22 21:01 [Buildroot] [PATCH 0/2] swupdate: customization of default website path Jordan Yelloz
@ 2016-06-22 21:01 ` Jordan Yelloz
  2016-06-22 21:01 ` [Buildroot] [PATCH 2/2] swupdate: updated help of INSTALL_WEBSITE config Jordan Yelloz
  2016-07-01 21:34 ` [Buildroot] [PATCH 0/2] swupdate: customization of default website path Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Jordan Yelloz @ 2016-06-22 21:01 UTC (permalink / raw)
  To: buildroot

Some systems run on an empty /var tmpfs and would prefer the website
data installed in /usr/share/swupdate/www or something similar so this
allows the website data to go somewhere else. The default location of
/var/www/swupdate is preserved.

Signed-off-by: Jordan Yelloz <jordan@yelloz.me>
---
 package/swupdate/Config.in   |  9 +++++++++
 package/swupdate/swupdate.mk | 11 ++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/package/swupdate/Config.in b/package/swupdate/Config.in
index 1d14a7c..bc90a2f 100644
--- a/package/swupdate/Config.in
+++ b/package/swupdate/Config.in
@@ -51,6 +51,15 @@ config BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
 	  This is necessary if you want to run swupdate with the embedded
 	  webserver and do not provide an own website to be installed to
 	  /var/www/swupdate.
+
+if BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
+
+config BR2_PACKAGE_SWUPDATE_WEBSITE_PATH
+	string "location of swupdate website data"
+	default "/var/www/swupdate"
+
+endif
+
 endif
 
 comment "swupdate needs a toolchain w/ threads"
diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk
index f49cbaa..d479416 100644
--- a/package/swupdate/swupdate.mk
+++ b/package/swupdate/swupdate.mk
@@ -114,11 +114,16 @@ endef
 
 define SWUPDATE_INSTALL_TARGET_CMDS
 	$(INSTALL) -D -m 0755 $(@D)/swupdate $(TARGET_DIR)/usr/bin/swupdate
-	$(if $(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE), \
-		mkdir -p $(TARGET_DIR)/var/www/swupdate; \
-		cp -dpf $(@D)/www/* $(TARGET_DIR)/var/www/swupdate)
+	$(SWUPDATE_INSTALL_TARGET_WEBSITE_CMDS)
 endef
 
+ifeq ($(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE),y)
+define SWUPDATE_INSTALL_TARGET_WEBSITE_CMDS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)$(BR2_PACKAGE_SWUPDATE_WEBSITE_PATH)
+	$(INSTALL) -m 0644 $(@D)/www/* $(TARGET_DIR)$(BR2_PACKAGE_SWUPDATE_WEBSITE_PATH)
+endef
+endif
+
 # Checks to give errors that the user can understand
 # Must be before we call to kconfig-package
 ifeq ($(BR2_PACKAGE_SWUPDATE)$(BR_BUILDING),yy)
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] swupdate: updated help of INSTALL_WEBSITE config
  2016-06-22 21:01 [Buildroot] [PATCH 0/2] swupdate: customization of default website path Jordan Yelloz
  2016-06-22 21:01 ` [Buildroot] [PATCH 1/2] swupdate: allowed website install path Jordan Yelloz
@ 2016-06-22 21:01 ` Jordan Yelloz
  2016-07-01 21:34 ` [Buildroot] [PATCH 0/2] swupdate: customization of default website path Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Jordan Yelloz @ 2016-06-22 21:01 UTC (permalink / raw)
  To: buildroot

Some explanation was added about how to use the new configuration option
and how to properly run the swupdate website using the package-installed
website data.

Signed-off-by: Jordan Yelloz <jordan@yelloz.me>
---
 package/swupdate/Config.in | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/package/swupdate/Config.in b/package/swupdate/Config.in
index bc90a2f..7896b84 100644
--- a/package/swupdate/Config.in
+++ b/package/swupdate/Config.in
@@ -46,11 +46,16 @@ config BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
 	bool "install default website"
 	default y
 	help
-	  Install the provided website to /var/www/swupdate.
+	  Install the provided website.
 
-	  This is necessary if you want to run swupdate with the embedded
-	  webserver and do not provide an own website to be installed to
-	  /var/www/swupdate.
+	  This is necessary if you want to run swupdate with the embedded webserver
+	  and do not provide a custom website to be installed in your rootfs.
+
+	  You can customize the installation path of the static website data with
+	  the symbol BR2_PACKAGE_SWUPDATE_WEBSITE_PATH and add that as an option to
+	  the mongoose server when running swupdate using an invocation similar to:
+
+	  swupdate -w '-document_root /var/www/swupdate'
 
 if BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 0/2] swupdate: customization of default website path
  2016-06-22 21:01 [Buildroot] [PATCH 0/2] swupdate: customization of default website path Jordan Yelloz
  2016-06-22 21:01 ` [Buildroot] [PATCH 1/2] swupdate: allowed website install path Jordan Yelloz
  2016-06-22 21:01 ` [Buildroot] [PATCH 2/2] swupdate: updated help of INSTALL_WEBSITE config Jordan Yelloz
@ 2016-07-01 21:34 ` Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-07-01 21:34 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 22 Jun 2016 14:01:23 -0700, Jordan Yelloz wrote:
> This patch allows for customization of the destination directory of the
> swupdate default webserver static files. Some configurations use a read-only
> rootfs and have a tmpfs mounted on /var so /var/www/swupdate is not an option
> for those systems. The newly added option allows users to install the website
> files in somewhere more stable like a subdirectory of /usr/share/swupdate or
> /usr/share/factory in the case of a volatile /var.
> 
> The previous fixed value of /var/www/swupdate is preserved as the default so
> this change shouldn't disturb any existing configurations.

Thanks for your proposal. However, it's Buildroot's policy to install
all the web-related stuff in /var/www. Nothing prevents you from moving
things around in a post-build script, and I think that's what we would
recommend in your situation.

Look at all the jquery* packages, the bootstrap package, and many more
packages. We can't add an option for all of them, so we prefer to
install in a default location that is somewhat sane, and leave it to
post-build scripts to move things around if needed.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-01 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 21:01 [Buildroot] [PATCH 0/2] swupdate: customization of default website path Jordan Yelloz
2016-06-22 21:01 ` [Buildroot] [PATCH 1/2] swupdate: allowed website install path Jordan Yelloz
2016-06-22 21:01 ` [Buildroot] [PATCH 2/2] swupdate: updated help of INSTALL_WEBSITE config Jordan Yelloz
2016-07-01 21:34 ` [Buildroot] [PATCH 0/2] swupdate: customization of default website path Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.