Files
Stan Grishin 6b271164d8 luci-app-advanced-reboot: bugfix: actual partition switch
At some point after r7, when I no longer had the dual boot device readily
available for testing, a regression was introduced that the RPCD script
would not actually perform the partition switch.
Thanks to @bd0426 for report and @Jackie264 for fixing the issue.

advanced-reboot.js
* simplify partition number validation in handleAlternativeReboot
* reformat text copy

RPCD script
* obtain OpenWrt version from "$OPENWRT_RELEASE" not "$PRETTY_NAME" for
  the snapshot compatibility
* refactor parameter processing for boot_partition function
* add logging/better output on error in boot_partition

test.sh
* introduce a test file for heartbeat check of the RPCD script

Signed-off-by: Stan Grishin <stangri@melmac.ca>
2026-01-21 03:31:36 +00:00

49 lines
1.8 KiB
Makefile

# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright 2017-2026 MOSSDeF, Stan Grishin (stangri@melmac.ca).
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-advanced-reboot
PKG_LICENSE:=AGPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_VERSION:=1.1.1
PKG_RELEASE:=15
PKG_BUILD_DEPENDS:=jq/host
LUCI_TITLE:=Advanced Linksys Reboot Web UI
LUCI_URL:=https://github.com/stangri/luci-app-advanced-reboot/
LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot supported Linksys and ZyXEL routers to\
an alternative partition. Also provides Web UI to shut down (power off) your device. Supported dual-partition\
routers are listed at https://docs.openwrt.melmac.ca/luci-app-advanced-reboot/
LUCI_DEPENDS:=+luci-base +jshn
define Package/$(PKG_NAME)/config
# shown in make menuconfig <Help>
help
$(LUCI_TITLE)
.
Version: $(PKG_VERSION)-$(PKG_RELEASE)
endef
include ../../luci.mk
# Prune individual device JSON directories from the package image.
# The default LuCI install logic from luci.mk copies everything under
# htdocs/, root/, etc. We let it run, then remove folders we keep only
# in source control.
define Package/$(PKG_NAME)/install
$(call Package/$(PKG_NAME)/install/default,$(1))
@mkdir -p $(1)/usr/share/advanced-reboot
@if [ -d $(1)/usr/share/advanced-reboot/devices ] \
&& ls $(1)/usr/share/advanced-reboot/devices/*.json >/dev/null 2>&1; then \
$(STAGING_DIR_HOST)/bin/jq -s '.' $(1)/usr/share/advanced-reboot/devices/*.json \
> $(1)/usr/share/advanced-reboot/devices.json; \
fi
@if [ -s $(1)/usr/share/advanced-reboot/devices.json ]; then \
$(RM) -r $(1)/usr/share/advanced-reboot/devices $(1)/usr/share/advanced-reboot/devices.disabled || true; \
fi
endef
# call BuildPackage - OpenWrt buildroot signature