sys-boot/rpi-imager: add drivelist filter useflag

This commit is contained in:
Mister Smoer 2023-01-11 16:20:20 +00:00 committed by Maciej Barć
parent c30f012701
commit 3f06de4d40
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,37 @@
# Expose drivelist filtering as cmake variable
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -134,6 +134,17 @@ else()
add_definitions(-DTELEMETRY_ENABLED_DEFAULT=false)
endif()
+if(DEFINED DRIVELIST_FILTER_SYSTEM_DRIVES)
+ if(DRIVELIST_FILTER_SYSTEM_DRIVES)
+ # Hide system drives from list
+ add_definitions(-DDRIVELIST_FILTER_SYSTEM_DRIVES=true)
+ else()
+ add_definitions(-DDRIVELIST_FILTER_SYSTEM_DRIVES=false)
+ endif()
+else()
+ add_definitions(-DDRIVELIST_FILTER_SYSTEM_DRIVES=true)
+endif()
+
if(ENABLE_CHECK_VERSION)
add_definitions(-DCHECK_VERSION_DEFAULT=true)
else()
--- a/src/config.h
+++ b/src/config.h
@@ -19,9 +19,6 @@
/* Hash algorithm for verifying (uncompressed image) checksum */
#define OSLIST_HASH_ALGORITHM QCryptographicHash::Sha256
-/* Hide system drives from list */
-#define DRIVELIST_FILTER_SYSTEM_DRIVES true
-
/* Update progressbar every 0.1 second */
#define PROGRESS_UPDATE_INTERVAL 100
--
2.38.2

View File

@ -8,4 +8,8 @@
<upstream> <upstream>
<remote-id type="github">raspberrypi/rpi-imager</remote-id> <remote-id type="github">raspberrypi/rpi-imager</remote-id>
</upstream> </upstream>
<use>
<flag name="filter-drivelist">Filters list of drives to just display USB-Drives, SD-Cards and NVME (root excluded)</flag>
</use>
</pkgmetadata> </pkgmetadata>

View File

@ -42,10 +42,17 @@ DEPEND="
${RDEPEND} ${RDEPEND}
" "
IUSE="+filter-drivelist"
PATCHES=(
"${FILESDIR}/${PV}-move-DRIVELIST_FILTER_SYSTEM_DRIVES-to-cmake-arg.patch"
)
src_configure() { src_configure() {
local mycmakeargs=( local mycmakeargs=(
-DENABLE_CHECK_VERSION=OFF -DENABLE_CHECK_VERSION=OFF
-DENABLE_TELEMETRY=OFF -DENABLE_TELEMETRY=OFF
-DDRIVELIST_FILTER_SYSTEM_DRIVES=$(usex filter-drivelist)
) )
cmake_src_configure cmake_src_configure