Skip to contentSkip to conversation

30_os-prober: add $onstr ot top level Linux entries too

PATCH In review Andrey Borzenkov 2 participants 5 messages Apr 5, 2013 – Apr 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 30_os-prober: add $onstr ot top level Linux entries too

This fixes two issues

1. It visually distinguishes between multiple installations of the same OS version. Currently all of them get identical titles.

2. linux prober is using "(on /dev/xxx)" as indication that entry has to be skipped. Top level entries should be skipped too.

$onstr was already appended to all other generated Linux menu entries.

---
 util/grub.d/30_os-prober.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
util/grub.d/30_os-prober.in +2 -2
index bf47dc3..4cd45e8 100644
@@ -186,7 +186,7 @@ EOF
 
 	if [ "x$is_first_entry" = xtrue ]; then
             cat << EOF
-menuentry '$(echo "$OS" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
+menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
 EOF
 	    save_default_entry | grub_add_tab
 	    printf '%s\n' "${prepare_boot_cache}"
@@ -201,7 +201,7 @@ EOF
         cat << EOF
 }
 EOF
-	    echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
+	    echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
 	    is_first_entry=false
 	fi
 	title="${LLABEL} $onstr"
Signature · 1 line
tg: (f3399bf..) u/linux-onstr (depends on: master)
#1 lore raw
Quoted 5 lines · Andrey Borzenkov

This fixes two issues

1. It visually distinguishes between multiple installations of the same OS version. Currently all of them get identical titles.

I don't know how "speaking" the device names are in practice. They are not stable and what is sda1 under one install can be sdb1 under another one. Perhaps we should use some other kind of identifier for this.

Quoted 2 lines

2. linux prober is using "(on /dev/xxx)" as indication that entry has to be skipped. Top level entries should be skipped too.

This is improper. This string can be translated and e.g. '(на /dev/xxx)' or '(auf /dev/xxx)' won't match '(on /dev/xxx)'. "$menuentry_id_option 'osprober-" should be used instead (and (on ...) be kept in or-way for backward compatibility).

Quoted 31 lines

$onstr was already appended to all other generated Linux menu entries.

---
 util/grub.d/30_os-prober.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
util/grub.d/30_os-prober.in +2 -2
index bf47dc3..4cd45e8 100644
@@ -186,7 +186,7 @@ EOF
 
 	if [ "x$is_first_entry" = xtrue ]; then
             cat << EOF
-menuentry '$(echo "$OS" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
+menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
 EOF
 	    save_default_entry | grub_add_tab
 	    printf '%s\n' "${prepare_boot_cache}"
@@ -201,7 +201,7 @@ EOF
         cat << EOF
 }
 EOF
-	    echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
+	    echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
 	    is_first_entry=false
 	fi
 	title="${LLABEL} $onstr"
#2 lore raw

В Sat, 06 Apr 2013 21:39:24 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 12 lines · Andrey Borzenkov
Quoted 6 lines

This fixes two issues

1. It visually distinguishes between multiple installations of the same OS version. Currently all of them get identical titles.

I don't know how "speaking" the device names are in practice. They are not stable and what is sda1 under one install can be sdb1 under another one. Perhaps we should use some other kind of identifier for this.

Well,

a) those names are from the perspective of a single installation only. In this respect it does not matter how another install calls it.

b) this is already used for some of menu entries. So it is just to establish consistency. If something better is invented, I am fine with it, but current situation is inconsistent.

Quoted 8 lines
Quoted 2 lines

2. linux prober is using "(on /dev/xxx)" as indication that entry has to be skipped. Top level entries should be skipped too.

This is improper. This string can be translated and e.g. '(на /dev/xxx)' or '(auf /dev/xxx)' won't match '(on /dev/xxx)'. "$menuentry_id_option 'osprober-" should be used instead (and (on ...) be kept in or-way for backward compatibility).

Ah. Did not occur to me, thank you for idea!

#3 lore raw
In reply to Andrey Borzenkov
Quoted 4 lines · Andrey Borzenkov

This fixes two issues

1. It visually distinguishes between multiple installations of the same OS version. Currently all of them get identical titles.

Go ahead

Quoted 4 lines

2. linux prober is using "(on /dev/xxx)" as indication that entry has to be skipped. Top level entries should be skipped too.

This part still should be fixed in os-prober

Quoted 30 lines

$onstr was already appended to all other generated Linux menu entries.

---
 util/grub.d/30_os-prober.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
util/grub.d/30_os-prober.in +2 -2
index bf47dc3..4cd45e8 100644
@@ -186,7 +186,7 @@ EOF
 
 	if [ "x$is_first_entry" = xtrue ]; then
             cat << EOF
-menuentry '$(echo "$OS" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
+menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
 EOF
 	    save_default_entry | grub_add_tab
 	    printf '%s\n' "${prepare_boot_cache}"
@@ -201,7 +201,7 @@ EOF
         cat << EOF
 }
 EOF
-	    echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
+	    echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
 	    is_first_entry=false
 	fi
 	title="${LLABEL} $onstr"
#4 lore raw

В Thu, 11 Apr 2013 00:13:55 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 9 lines · Andrey Borzenkov
Quoted 5 lines

This fixes two issues

1. It visually distinguishes between multiple installations of the same OS version. Currently all of them get identical titles.

Go ahead

OK, as I missed one place in my previous patch, I took liberty to fix it and push directly to test commit procedure.

One question - is commit message taken from ChangeLog or has to be supplied directly? They are always the same and it looks a bit silly to duplicate them in two places.