summaryrefslogtreecommitdiffstats
path: root/make_slackware_live.sh
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2023-02-20 21:20:01 +0100
committer Eric Hameleers <alien@slackware.com>2023-02-20 21:20:01 +0100
commit0e37b53e2f7699626bb10d11e5a4075218629318 (patch)
treeaee821d1dbe5f26a783d04addcfb5a5396d3720e /make_slackware_live.sh
parentd79038354fb3b69a5fda745e6bd688e85f4db460 (diff)
downloadliveslak-0e37b53e2f7699626bb10d11e5a4075218629318.tar.gz
liveslak-0e37b53e2f7699626bb10d11e5a4075218629318.tar.xz
Grub: more user-friendly timezone selection menu
Diffstat (limited to '')
-rwxr-xr-xmake_slackware_live.sh60
1 files changed, 37 insertions, 23 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index a9e94c0..ccf9de9 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -820,7 +820,7 @@ function gen_uefimenu() {
GRUBDIR="$1"
- # Generate the grub menu structure - many files because of the selection tree.
+ # Generate the grub menu structure.
# I expect the directory to exist... but you never know.
mkdir -p ${GRUBDIR}
@@ -902,6 +902,9 @@ EOL
done
# Create the timezone selection menu:
+ # Code used from Slackware script:
+ # source/a/glibc-zoneinfo/timezone-scripts/output-updated-timeconfig.sh
+ # Author: Patrick Volkerding <volkerdi@slackware.com>
TZDIR="/usr/share/zoneinfo"
TZLIST=$(mktemp -t alientz.XXXXXX)
if [ ! -f $TZLIST ]; then
@@ -909,35 +912,46 @@ EOL
cleanup
exit 1
fi
- # First, create a list of timezones:
- # This code taken from Slackware script:
- # source/a/glibc-zoneinfo/timezone-scripts/output-updated-timeconfig.sh
- # Author: Patrick Volkerding <volkerdi@slackware.com>
- # US/ first:
- ( cd $TZDIR
- find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep "^US/" | while read zone ; do
- echo "${zone}" >> $TZLIST
- done
- )
- # Don't list right/ and posix/ zones:
- ( cd $TZDIR
- find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep -v "^US/" | grep -v "^posix/" | grep -v "^right/" | while read zone ; do
- echo "${zone}" >> $TZLIST
- done
- )
- for TZ in $(cat $TZLIST); do
- # Add this entry to the keyboard selection menu:
+
+ # Structured tz select instead of dumping them all in one menu:
+ for TZ in US Africa America Asia Atlantic Australia Etc Europe Pacific; do
+ # First the submenu for this zone:
cat <<EOL >> ${GRUBDIR}/tz.cfg
-menuentry "${TZ}" {
- set sl_tz="$TZ"
+submenu "${TZ} >" {
+ configfile \$prefix/${TZ}/tz.cfg
+}
+
+EOL
+ # Then the locations for this zone:
+ mkdir ${GRUBDIR}/${TZ}
+ ( cd $TZDIR/$TZ
+ find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f2- -d / | sort | while read LOCN ; do
+ # Add this entry to the keyboard selection menu:
+ cat <<EOL >> ${GRUBDIR}/${TZ}/tz.cfg
+menuentry "${TZ}/${LOCN}" {
+ set sl_tz="${TZ}/${LOCN}"
export sl_tz
configfile \$prefix/grub.cfg
}
EOL
- rm -f $TZLIST
-
+ done
+ )
done
+ # Timezone data in rootdirectory follows:
+ ( cd $TZDIR
+ find . -type f -mindepth 1 -maxdepth 1 | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | while read ZONE ; do
+ # Add this entry to the keyboard selection menu:
+ cat <<EOL >> ${GRUBDIR}/tz.cfg
+menuentry "${ZONE}" {
+ set sl_tz="$ZONE"
+ export sl_tz
+ configfile \$prefix/grub.cfg
+}
+
+EOL
+ done
+ )
} # End of gen_uefimenu()