Merge pull request #435 from PartialVolume/auto-update-nwipe-version-in-banner

Auto update nwipe banner and version.txt with version tag or commit SHA, examples
ShredOS v2025.11_28_i686_26ece7a-commit-dev
ShredOS v2025.11_28_i686_v0.39
This commit is contained in:
PartialVolume
2026-01-18 22:39:25 +00:00
committed by GitHub
4 changed files with 51 additions and 16 deletions

View File

@@ -1 +1 @@
2025.11_28_i686_0.40
2025.11_28_i686_26ece7a-commit-dev

View File

@@ -12,7 +12,7 @@ image boot.vfat {
file autorun.inf { image = 'autorun.inf' }
}
size = 74141440
size = 74145536
}
image shredos.img {

View File

@@ -1,7 +1,7 @@
BR2_x86_i686=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_TARGET_GENERIC_HOSTNAME="shredos"
BR2_TARGET_GENERIC_ISSUE="Welcome to ShredOS https://github.com/PartialVolume/shredos.i686"
BR2_INIT_SYSV=y
@@ -16,32 +16,32 @@ BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/shredos/kernel-defconfig"
BR2_PACKAGE_GZIP=y
BR2_PACKAGE_XZ=y
BR2_PACKAGE_EDID_DECODE=y
BR2_PACKAGE_LM_SENSORS=y
BR2_PACKAGE_TFTPD=y
BR2_PACKAGE_HEXEDIT=y
BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y
BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT=y
BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_EDID_DECODE=y
BR2_PACKAGE_HDPARM=y
BR2_PACKAGE_KBD=y
BR2_PACKAGE_LM_SENSORS=y
BR2_PACKAGE_NVME=y
BR2_PACKAGE_SG3_UTILS=y
BR2_PACKAGE_SG3_UTILS_PROGS=y
BR2_PACKAGE_HEXEDIT=y
BR2_PACKAGE_SMARTMONTOOLS=y
BR2_PACKAGE_LZ4=y
BR2_PACKAGE_KBD=y
BR2_PACKAGE_KERNEL_CMDLINE_EXTRACTOR=y
BR2_PACKAGE_NWIPE=y
BR2_PACKAGE_NWIPE_VERSION_GIT_REVISION=y
BR2_PACKAGE_NWIPE_GIT_REVISION="26ece7a0525370f6ba39cddc5e73000b3cd867d6"
BR2_PACKAGE_NCURSES_WCHAR=y
BR2_PACKAGE_UTF8PROC=y
BR2_PACKAGE_KERNEL_CMDLINE_EXTRACTOR=y
BR2_PACKAGE_LFTP=y
BR2_PACKAGE_LFTP_PROTO_SFTP=y
BR2_PACKAGE_NTP=y
BR2_PACKAGE_NTP_NTPDATE=y
BR2_PACKAGE_NTP_NTPTIME=y
BR2_PACKAGE_LFTP=y
BR2_PACKAGE_LFTP_PROTO_SFTP=y
BR2_PACKAGE_SMARTMONTOOLS=y
BR2_PACKAGE_TFTPD=y
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
BR2_PACKAGE_UTIL_LINUX_AGETTY=y
BR2_PACKAGE_UTIL_LINUX_FSCK=y

View File

@@ -4,14 +4,20 @@
#
################################################################################
# 'NWIPE_TAG' version that will be compiled, nwipe tags are of the form v0.40
# if BR2_PACKAGE_NWIPE_VERSION_STABLE is y else the git commit version will
# be installed as defined in Target Packages>libaries>other>nwipe
NWIPE_TAG = v0.39
# Select the Git reference based on the Kconfig choice.
ifeq ($(BR2_PACKAGE_NWIPE_VERSION_STABLE),y)
NWIPE_VERSION = v0.39
NWIPE_VERSION = $(NWIPE_TAG)
else ifeq ($(BR2_PACKAGE_NWIPE_VERSION_GIT_REVISION),y)
NWIPE_VERSION = $(call qstrip,$(BR2_PACKAGE_NWIPE_GIT_REVISION))
else
# Fallback should not happen because the choice enforces exactly one option
NWIPE_VERSION = v0.39
NWIPE_VERSION = $(NWIPE_TAG)
endif
# Default Git repository URL (never empty).
@@ -25,13 +31,42 @@ NWIPE_SITE_METHOD = git
NWIPE_DEPENDENCIES = ncurses parted dmidecode coreutils libconfig
################################################################################
# Version architecture nwipe banner updater (pre-build)
# SHREDOS version.txt and banner updater. Updates the nwipe version which
# could be a release version, such as 0.40 or a commit reference, such as
# e964dba-dev used by developers when working on non released code from the
# master branch.
################################################################################
SHREDOS_VERSION_FILE = board/shredos/fsoverlay/etc/shredos/version.txt
ifeq ($(BR2_PACKAGE_NWIPE),y)
ifeq ($(BR2_PACKAGE_NWIPE_VERSION_GIT_REVISION),y)
# Take first 7 characters of the git revision and append suffix
NWIPE_VERSION_BANNER := $(shell printf "%.7s-commit-dev" "$(BR2_PACKAGE_NWIPE_GIT_REVISION)")
else
NWIPE_VERSION_BANNER := $(NWIPE_VERSION)
endif
endif
define NWIPE_UPDATE_VERSION_TXT
@if [ -n "$(NWIPE_VERSION_BANNER)" ]; then \
echo "Updating version.txt and nwipe banner with Nwipe version: $(NWIPE_VERSION_BANNER)"; \
sed -i 's/\(.*_\)[^_]*$$/\1$(NWIPE_VERSION_BANNER)/' $(SHREDOS_VERSION_FILE); \
fi
endef
NWIPE_PRE_CONFIGURE_HOOKS += NWIPE_UPDATE_VERSION_TXT
######
################################################################################
# Version architecture nwipe banner updater (pre-build)
################################################################################
define NWIPE_INITSH
@echo "Updating version.txt for architecture: $(BR2_ARCH)"
@echo "Updating version.txt and nwipe banner with architecture: $(BR2_ARCH)"
@if [ "$(BR2_ARCH)" = "i686" ]; then \
sed -i 's/\(^.*_\)\(x86-64\|i686\)\(_.*\)/\1i686\3/' $(SHREDOS_VERSION_FILE); \