Index: tools/list_profiles.sh
===================================================================
--- tools/list_profiles.sh	(revision 8edec5347eb33f22b1815db3609ff69c0f618d63)
+++ tools/list_profiles.sh	(revision 91ece11b37af37970a1f99c6a8d892ea9b98420c)
@@ -2,4 +2,5 @@
 
 #
+# Copyright (c) 2021 Jiri Svoboda
 # Copyright (c) 2019 Jiří Zárevúcky
 # All rights reserved.
@@ -39,4 +40,17 @@
 CONFIG_DEFAULTS="${SOURCE_DIR}/defaults"
 
-# Find all the leaf subdirectories in the defaults directory.
-find ${CONFIG_DEFAULTS} -type d -links 2 -printf "%P\n" | sort
+# Find the leaf subdirectories in the defaults directory.
+level1dirs=`ls "$CONFIG_DEFAULTS"`
+for dname in $level1dirs; do
+	l2dirs=`ls "$CONFIG_DEFAULTS"/"$dname"`
+	havel2=
+	for dn in $l2dirs; do
+		if [ -d "$CONFIG_DEFAULTS/$dname/$dn" ]; then
+			echo "$dname/$dn"
+			havel2=true
+		fi
+	done
+	if [ -z "$havel2" ]; then
+		echo "$dname"
+	fi
+done
