petsam / horizontal-grub Goto Github PK
View Code? Open in Web Editor NEWThis script will transform the current grub configuration file generated by grub(2), to a fake-horizontal style.
License: GNU General Public License v3.0
This script will transform the current grub configuration file generated by grub(2), to a fake-horizontal style.
License: GNU General Public License v3.0
In Manjaro and possibly Arch, original grub.cfg cannot be read/written by group or others.
In other distros (that I remember) this was not the case.
In any case, a file attributes and timestamp collection before copying and attributes restoration is a good thing for unknown scenarios.
Will add this soon.
Hi petsam,
sorry for the many/much lines :-)
→ ~ horizontal-grub
++ id -u
+ (( 1000 == 0 ))
+ '[' -w /tmp ']'
++ date +%s
+ WorkDir=/tmp/safesync-1554020539
+ mkdir -p /tmp/safesync-1554020539
+ echo 'Created working directory :' /tmp/safesync-1554020539
Created working directory : /tmp/safesync-1554020539
+ cd /tmp/safesync-1554020539
+ '[' -f /bootgrub/grub.cfg ']'
+ echo 'Grub configuration /boot/grub/grub.cfg was not found.'
Grub configuration /boot/grub/grub.cfg was not found.
+ echo Exiting...
Exiting...
+ exit
change bootgrub to boot/grub
if [ -f /boot/grub/grub.cfg ]; then
if [ -r /boot/grub/grub.cfg ]; then
cp /boot/grub/grub.cfg grub.cfg
→ ~ horizontal-grub
++ id -u
+ (( 1000 == 0 ))
+ '[' -w /tmp ']'
++ date +%s
+ WorkDir=/tmp/safesync-1554020763
+ mkdir -p /tmp/safesync-1554020763
+ echo 'Created working directory :' /tmp/safesync-1554020763
Created working directory : /tmp/safesync-1554020763
+ cd /tmp/safesync-1554020763
+ '[' -f /boot/grub/grub.cfg ']'
+ '[' -r /boot/grub/grub.cfg ']'
+ pkexec cp /boot/grub/grub.cfg grub.cfg
+ pkexec chown mint grub.cfg
+ cat grub.cfg
+ grep -Fm 1 -B 2000 '### BEGIN /etc/grub.d/10_linux ###'
cat: grub.cfg: Datei oder Verzeichnis nicht gefunden
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### BEGIN /etc/grub.d/10_linux ###'
+ grep -nv '^#'
+ tr ' ' '^'
+ grep -Fm 1 -B 2000 '### END /etc/grub.d/10_linux ###'
cat: grub.cfg: Datei oder Verzeichnis nicht gefunden
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### BEGIN /etc/grub.d/30_os-prober ###'
+ grep -Fm 1 -B 2000 '### END /etc/grub.d/30_os-prober ###'
+ tr ' ' '^'
+ grep -nv '^#'
cat: grub.cfg: Datei oder Verzeichnis nicht gefunden
++ cat osprobed.cfg
++ grep -E '\:submenu|\:menuentry|\:}'
+ OSproberDistros=
++ cat maindistro.cfg
++ grep -E '\:submenu|\:menuentry|\:}'
+ MainDistro=
+ echo '
#### Trasformed grub menu to pseudo-horizontal by horizontal-grub ####
'
+ ParseDistros osprobed.cfg
+ '[' 1 = 0 ']'
+ '[' 1 = 1 ']'
+ echo 'Only one argument passed. Something went wrong. Exiting...'
Only one argument passed. Something went wrong. Exiting...
+ return 1
+ OsProberLastLine=
+ echo 'osprober last line: '
osprober last line:
+ ParseDistros maindistro.cfg
+ '[' 1 = 0 ']'
+ '[' 1 = 1 ']'
+ echo 'Only one argument passed. Something went wrong. Exiting...'
Only one argument passed. Something went wrong. Exiting...
+ return 1
+ (( OsProberLastLine+=1 ))
+ cat osprobed.cfg
+ cut -d : -s -f 2,3,4
+ grep -A 2000 '^1\:'
+ tr '^' ' '
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### END /etc/grub.d/30_os-prober ###'
cat: grub.cfg: Datei oder Verzeichnis nicht gefunden
+ '[' -s horizontal-grub.cfg ']'
+ echo 'The new configuration file is created'
The new configuration file is created
+ true
+ read -p 'Do you want to save it as your current /boot/grub/grub.cfg?
[Y]es [N]o' SaveGrubcfg
Do you want to save it as your current /boot/grub/grub.cfg?
[Y]es [N]oy
+ echo ''
+ case $SaveGrubcfg in
+ echo 'Copying to system...'
Copying to system...
++ date +%s
+ pkexec cp -b --suffix .1554020782 /tmp/safesync-1554020763/grub.cfg /boot/grub/grub.cfg
/usr/bin/cp: der Aufruf von stat für '/tmp/safesync-1554020763/grub.cfg' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
+ break
+ exit
Two times Password question, did not change the grub.cfg
I changed to
cd $WorkDir
sudo cp /boot/grub/grub.cfg grub.cfg
# Split sections
→ ~ horizontal-grub
++ id -u
+ (( 1000 == 0 ))
+ '[' -w /tmp ']'
++ date +%s
+ WorkDir=/tmp/safesync-1554021293
+ mkdir -p /tmp/safesync-1554021293
+ echo 'Created working directory :' /tmp/safesync-1554021293
Created working directory : /tmp/safesync-1554021293
+ cd /tmp/safesync-1554021293
+ sudo cp /boot/grub/grub.cfg grub.cfg
[sudo] Passwort für mint:
+ cat grub.cfg
+ grep -Fm 1 -B 2000 '### BEGIN /etc/grub.d/10_linux ###'
cat: grub.cfg: Keine Berechtigung
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### BEGIN /etc/grub.d/10_linux ###'
+ grep -Fm 1 -B 2000 '### END /etc/grub.d/10_linux ###'
+ grep -nv '^#'
cat: grub.cfg+ tr ' ' '^'
: Keine Berechtigung
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### BEGIN /etc/grub.d/30_os-prober ###'
+ grep -nv '^#'
+ grep -Fm 1 -B 2000 '### END /etc/grub.d/30_os-prober ###'
+ tr ' ' '^'
cat: grub.cfg: Keine Berechtigung
++ cat osprobed.cfg
++ grep -E '\:submenu|\:menuentry|\:}'
+ OSproberDistros=
++ cat maindistro.cfg
++ grep -E '\:submenu|\:menuentry|\:}'
+ MainDistro=
+ echo '
#### Trasformed grub menu to pseudo-horizontal by horizontal-grub ####
'
+ ParseDistros osprobed.cfg
+ '[' 1 = 0 ']'
+ '[' 1 = 1 ']'
+ echo 'Only one argument passed. Something went wrong. Exiting...'
Only one argument passed. Something went wrong. Exiting...
+ return 1
+ OsProberLastLine=
+ echo 'osprober last line: '
osprober last line:
+ ParseDistros maindistro.cfg
+ '[' 1 = 0 ']'
+ '[' 1 = 1 ']'
+ echo 'Only one argument passed. Something went wrong. Exiting...'
Only one argument passed. Something went wrong. Exiting...
+ return 1
+ (( OsProberLastLine+=1 ))
+ cat osprobed.cfg
+ grep -A 2000 '^1\:'
+ cut -d : -s -f 2,3,4
+ tr '^' ' '
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### END /etc/grub.d/30_os-prober ###'
cat: grub.cfg: Keine Berechtigung
+ '[' -s horizontal-grub.cfg ']'
+ echo 'The new configuration file is created'
The new configuration file is created
+ true
+ read -p 'Do you want to save it as your current /boot/grub/grub.cfg?
[Y]es [N]o' SaveGrubcfg
Do you want to save it as your current /boot/grub/grub.cfg?
[Y]es [N]oY
+ echo ''
+ case $SaveGrubcfg in
+ echo 'Copying to system...'
Copying to system...
++ date +%s
+ pkexec cp -b --suffix .1554021312 /tmp/safesync-1554021293/grub.cfg /boot/grub/grub.cfg
+ break
+ exit
New grub.cfg.
→ ~ cd /tmp/safesync-1554021293
→ ~ ls
insgesamt 32K
-rw------- 1 root root 26K 31.03.2019 10:34 grub.cfg
-rw-r--r-- 1 mint mint 73 31.03.2019 10:34 horizontal-grub.cfg
-rw-r--r-- 1 mint mint 0 31.03.2019 10:34 maindistro.cfg
-rw-r--r-- 1 mint mint 0 31.03.2019 10:34 osprobed.cfg
No difference grub.cfg checked with meld.
Allways no legitimation
My simple cleaner for grub.cfg work only as root ;-)
[ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@"
https://forum.manjaro.org/t/clean-grub-cfg-with-a-script/60353?u=sgs
But I'm a bungler when it comes to bash scripts. :-D
→ ~ horizontal-grub
++ whoami
+ '[' mint '!=' root ']'
+ exec sudo -- /home/mint/bin/horizontal-grub
[sudo] Passwort für mint:
++ whoami
+ '[' root '!=' root ']'
+ '[' -w /tmp ']'
++ date +%s
+ WorkDir=/tmp/safesync-1554023326
+ mkdir -p /tmp/safesync-1554023326
+ echo 'Created working directory :' /tmp/safesync-1554023326
Created working directory : /tmp/safesync-1554023326
+ cd /tmp/safesync-1554023326
+ sudo cp /boot/grub/grub.cfg grub.cfg
+ cat grub.cfg
+ grep -Fm 1 -B 2000 '### BEGIN /etc/grub.d/10_linux ###'
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### BEGIN /etc/grub.d/10_linux ###'
+ grep -Fm 1 -B 2000 '### END /etc/grub.d/10_linux ###'
+ grep -nv '^#'
+ tr ' ' '^'
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### BEGIN /etc/grub.d/30_os-prober ###'
+ grep -Fm 1 -B 2000 '### END /etc/grub.d/30_os-prober ###'
+ grep -nv '^#'
+ tr ' ' '^'
++ cat osprobed.cfg
++ grep -E '\:submenu|\:menuentry|\:}'
+ OSproberDistros='2:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{
14:}
15:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{
93:}
95:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{
107:}
108:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{
186:}
188:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{
200:}
201:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{
279:}'
++ cat maindistro.cfg
++ grep -E '\:submenu|\:menuentry|\:}'
+ MainDistro='2:menuentry^'\''Manjaro^Linux'\''^--class^manjaro^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''gnulinux-simple-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{
17:}
18:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux'\''^$menuentry_id_option^'\''gnulinux-advanced-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{
81:}'
+ echo '
#### Trasformed grub menu to pseudo-horizontal by horizontal-grub ####
'
+ ParseDistros osprobed.cfg '2:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{' '14:}' '15:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{' '93:}' '95:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{' '107:}' '108:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{' '186:}' '188:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{' '200:}' '201:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{' '279:}'
+ '[' 13 = 0 ']'
+ '[' 13 = 1 ']'
+ echo 13 ' arguments passed. Starting parsing...'
13 arguments passed. Starting parsing...
+ local EntriesType=osprobed.cfg
+ echo 'Entry Type is of ' osprobed.cfg
Entry Type is of osprobed.cfg
+ shift
+ echo 'Arguments left are :' 12
Arguments left are : 12
+ local -a DistroSections
+ SentDBs=12
+ (( i=0 ))
+ (( i<12 ))
+ DistroSections[$i]='2:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='14:}'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='15:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='93:}'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='95:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='107:}'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='108:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='186:}'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='188:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='200:}'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='201:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ DistroSections[$i]='279:}'
+ shift
+ (( i++ ))
+ (( i<12 ))
+ ProbedEntry=0
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '2:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry=menuentry
+ echo 'Entry is of Type ' menuentry
Entry is of Type menuentry
+ '[' menuentry = menuentry ']'
++ echo '2:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{'
++ cut -d : -f1
+ MainEntry[$ProbedEntry]=2
+ echo 'Skipping... ' 2
Skipping... 2
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '14:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 1 = 0 ']'
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '15:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry=submenu
+ echo 'Entry is of Type ' submenu
Entry is of Type submenu
+ '[' submenu = menuentry ']'
+ '[' submenu = submenu ']'
+ IsParsable=0
++ echo '15:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sda2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-9030b9ef-9aab-4578-92c7-b085e2b31cbb'\''^{'
++ cut -d : -f1
+ EntryStart[$ProbedEntry]=15
+ for EntryBorder in ${DistroSections[@]}
++ echo '93:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 0 = 0 ']'
++ echo '93:}'
++ cut -d : -f1
+ EntryEnd[$ProbedEntry]=93
+ LastBracketLine=93
+ echo 'Distro ' 0 'Main Entry: ' 2 'Start line: ' 15 'End line: ' 93 'Last Bracket: ' 93
Distro 0 Main Entry: 2 Start line: 15 End line: 93 Last Bracket: 93
+ (( ProbedEntry+=1 ))
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ grep -iwoE 'submenu|menuentry|}'
++ echo '95:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{'
+ CurrEntry=menuentry
+ echo 'Entry is of Type ' menuentry
Entry is of Type menuentry
+ '[' menuentry = menuentry ']'
++ echo '95:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{'
++ cut -d : -f1
+ MainEntry[$ProbedEntry]=95
+ echo 'Skipping... ' 95
Skipping... 95
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '107:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 1 = 0 ']'
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '108:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry=submenu
+ echo 'Entry is of Type ' submenu
Entry is of Type submenu
+ '[' submenu = menuentry ']'
+ '[' submenu = submenu ']'
+ IsParsable=0
++ echo '108:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb2)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-04d0077e-4517-4d2c-86d6-f3f60acc4712'\''^{'
++ cut -d : -f1
+ EntryStart[$ProbedEntry]=108
+ for EntryBorder in ${DistroSections[@]}
++ echo '186:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 0 = 0 ']'
++ echo '186:}'
++ cut -d : -f1
+ EntryEnd[$ProbedEntry]=186
+ LastBracketLine=186
+ echo 'Distro ' 1 'Main Entry: ' 95 'Start line: ' 108 'End line: ' 186 'Last Bracket: ' 186
Distro 1 Main Entry: 95 Start line: 108 End line: 186 Last Bracket: 186
+ (( ProbedEntry+=1 ))
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '188:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry=menuentry
+ echo 'Entry is of Type ' menuentry
Entry is of Type menuentry
+ '[' menuentry = menuentry ']'
++ echo '188:menuentry^'\''Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^--class^manjarolinux^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''osprober-gnulinux-simple-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{'
++ cut -d : -f1
+ MainEntry[$ProbedEntry]=188
+ echo 'Skipping... ' 188
Skipping... 188
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '200:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 1 = 0 ']'
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '201:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry=submenu
+ echo 'Entry is of Type ' submenu
Entry is of Type submenu
+ '[' submenu = menuentry ']'
+ '[' submenu = submenu ']'
+ IsParsable=0
++ echo '201:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux^(18.0.4)^(auf^/dev/sdb3)'\''^$menuentry_id_option^'\''osprober-gnulinux-advanced-52cb2b74-6161-4bf2-859f-9934ffeda8b8'\''^{'
++ cut -d : -f1
+ EntryStart[$ProbedEntry]=201
+ for EntryBorder in ${DistroSections[@]}
++ echo '279:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 0 = 0 ']'
++ echo '279:}'
++ cut -d : -f1
+ EntryEnd[$ProbedEntry]=279
+ LastBracketLine=279
+ echo 'Distro ' 2 'Main Entry: ' 188 'Start line: ' 201 'End line: ' 279 'Last Bracket: ' 279
Distro 2 Main Entry: 188 Start line: 201 End line: 279 Last Bracket: 279
+ (( ProbedEntry+=1 ))
+ IsParsable=1
+ '[' osprobed.cfg = maindistro.cfg ']'
+ EntryOut=0
+ for StartLine in ${EntryStart[@]}
+ cat osprobed.cfg
+ grep '^15\:'
+ cut -d : -f2
+ tr '^' ' '
+ (( EntryOut+=1 ))
+ for StartLine in ${EntryStart[@]}
+ cat osprobed.cfg
+ grep '^108\:'
+ tr '^' ' '
+ cut -d : -f2
+ (( EntryOut+=1 ))
+ for StartLine in ${EntryStart[@]}
+ cat osprobed.cfg
+ grep '^201\:'
+ cut -d : -f2
+ tr '^' ' '
+ (( EntryOut+=1 ))
+ '[' 3 = 0 ']'
+ echo 'Adding Entry: ' 3
Adding Entry: 3
+ (( EntryOut-=1 ))
+ RStartLine=201
+ EntryLines=279
+ MainLine=188
+ (( RStartLine+=2 ))
+ (( EntryLines-=203 ))
+ echo 'Entry lines to add: ' 76
Entry lines to add: 76
+ cat osprobed.cfg
+ grep '^188\:'
+ cut -d : -s -f 2,3,4
+ tr '^' ' '
+ cat osprobed.cfg
+ grep -A 76 '^203\:'
+ tr '^' ' '
+ cut -d : -s -f 2,3,4
+ '[' 2 = 0 ']'
+ echo 'Adding Entry: ' 2
Adding Entry: 2
+ (( EntryOut-=1 ))
+ RStartLine=108
+ EntryLines=186
+ MainLine=95
+ (( RStartLine+=2 ))
+ (( EntryLines-=110 ))
+ echo 'Entry lines to add: ' 76
Entry lines to add: 76
+ cat osprobed.cfg
+ grep '^95\:'
+ cut -d : -s -f 2,3,4
+ tr '^' ' '
+ cat osprobed.cfg
+ grep -A 76 '^110\:'
+ cut -d : -s -f 2,3,4
+ tr '^' ' '
+ '[' 1 = 0 ']'
+ echo 'Adding Entry: ' 1
Adding Entry: 1
+ (( EntryOut-=1 ))
+ RStartLine=15
+ EntryLines=93
+ MainLine=2
+ (( RStartLine+=2 ))
+ (( EntryLines-=17 ))
+ echo 'Entry lines to add: ' 76
Entry lines to add: 76
+ cat osprobed.cfg
+ grep '^2\:'
+ cut -d : -s -f 2,3,4
+ tr '^' ' '
+ cat osprobed.cfg
+ grep -A 76 '^17\:'
+ cut -d : -s -f 2,3,4
+ tr '^' ' '
+ '[' 0 = 0 ']'
+ OsProberLastLine=279
+ echo 'osprober last line: ' 279
osprober last line: 279
+ ParseDistros maindistro.cfg '2:menuentry^'\''Manjaro^Linux'\''^--class^manjaro^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''gnulinux-simple-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{' '17:}' '18:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux'\''^$menuentry_id_option^'\''gnulinux-advanced-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{' '81:}'
+ '[' 5 = 0 ']'
+ '[' 5 = 1 ']'
+ echo 5 ' arguments passed. Starting parsing...'
5 arguments passed. Starting parsing...
+ local EntriesType=maindistro.cfg
+ echo 'Entry Type is of ' maindistro.cfg
Entry Type is of maindistro.cfg
+ shift
+ echo 'Arguments left are :' 4
Arguments left are : 4
+ local -a DistroSections
+ SentDBs=4
+ (( i=0 ))
+ (( i<4 ))
+ DistroSections[$i]='2:menuentry^'\''Manjaro^Linux'\''^--class^manjaro^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''gnulinux-simple-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{'
+ shift
+ (( i++ ))
+ (( i<4 ))
+ DistroSections[$i]='17:}'
+ shift
+ (( i++ ))
+ (( i<4 ))
+ DistroSections[$i]='18:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux'\''^$menuentry_id_option^'\''gnulinux-advanced-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{'
+ shift
+ (( i++ ))
+ (( i<4 ))
+ DistroSections[$i]='81:}'
+ shift
+ (( i++ ))
+ (( i<4 ))
+ ProbedEntry=0
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '2:menuentry^'\''Manjaro^Linux'\''^--class^manjaro^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''gnulinux-simple-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry=menuentry
+ echo 'Entry is of Type ' menuentry
Entry is of Type menuentry
+ '[' menuentry = menuentry ']'
++ echo '2:menuentry^'\''Manjaro^Linux'\''^--class^manjaro^--class^gnu-linux^--class^gnu^--class^os^$menuentry_id_option^'\''gnulinux-simple-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{'
++ cut -d : -f1
+ MainEntry[$ProbedEntry]=2
+ echo 'Skipping... ' 2
Skipping... 2
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '17:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 1 = 0 ']'
+ IsParsable=1
+ for EntryBorder in ${DistroSections[@]}
++ echo '18:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux'\''^$menuentry_id_option^'\''gnulinux-advanced-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry=submenu
+ echo 'Entry is of Type ' submenu
Entry is of Type submenu
+ '[' submenu = menuentry ']'
+ '[' submenu = submenu ']'
+ IsParsable=0
++ cut -d : -f1
++ echo '18:submenu^'\''Erweiterte^Optionen^für^Manjaro^Linux'\''^$menuentry_id_option^'\''gnulinux-advanced-4aaa187d-9945-433d-8bd2-309afbb8e717'\''^{'
+ EntryStart[$ProbedEntry]=18
+ for EntryBorder in ${DistroSections[@]}
++ echo '81:}'
++ grep -iwoE 'submenu|menuentry|}'
+ CurrEntry='}'
+ echo 'Entry is of Type ' '}'
Entry is of Type }
+ '[' '}' = menuentry ']'
+ '[' '}' = submenu ']'
+ '[' 0 = 0 ']'
++ cut -d : -f1
++ echo '81:}'
+ EntryEnd[$ProbedEntry]=81
+ LastBracketLine=81
+ echo 'Distro ' 0 'Main Entry: ' 2 'Start line: ' 18 'End line: ' 81 'Last Bracket: ' 81
Distro 0 Main Entry: 2 Start line: 18 End line: 81 Last Bracket: 81
+ (( ProbedEntry+=1 ))
+ IsParsable=1
+ '[' maindistro.cfg = maindistro.cfg ']'
+ EntryOut=1
+ '[' 1 = 0 ']'
+ echo 'Adding Entry: ' 1
Adding Entry: 1
+ (( EntryOut-=1 ))
+ RStartLine=18
+ EntryLines=81
+ MainLine=2
+ (( RStartLine+=2 ))
+ (( EntryLines-=20 ))
+ echo 'Entry lines to add: ' 61
Entry lines to add: 61
+ cut -d : -s -f 2,3,4
+ cat maindistro.cfg
+ grep '^2\:'
+ tr '^' ' '
+ grep -A 61 '^20\:'
+ cat maindistro.cfg
+ tr '^' ' '
+ cut -d : -s -f 2,3,4
+ '[' 0 = 0 ']'
+ (( OsProberLastLine+=1 ))
+ tr '^' ' '
+ grep -A 2000 '^280\:'
+ cut -d : -s -f 2,3,4
+ cat osprobed.cfg
+ cat grub.cfg
+ grep -Fm 1 -A 2000 '### END /etc/grub.d/30_os-prober ###'
+ '[' -s horizontal-grub.cfg ']'
+ echo 'The new configuration file is created'
The new configuration file is created
+ true
+ read -p 'Do you want to save it as your current /boot/grub/grub.cfg?
[Y]es [N]o' SaveGrubcfg
Do you want to save it as your current /boot/grub/grub.cfg?
[Y]es [N]oy
+ echo ''
+ case $SaveGrubcfg in
+ echo 'Copying to system...'
Copying to system...
++ date +%s
+ pkexec cp -b --suffix .1554023330 /tmp/safesync-1554023326/grub.cfg /boot/grub/grub.cfg
+ break
+ exit
The diff are in maindistro and osprobed :)
→ ~ cd /tmp/safesync-1554023326
→ ~ ls
insgesamt 80K
-rw------- 1 root root 26K 31.03.2019 11:08 grub.cfg
-rw-r--r-- 1 root root 22K 31.03.2019 11:08 horizontal-grub.cfg
-rw-r--r-- 1 root root 4,5K 31.03.2019 11:08 maindistro.cfg
-rw-r--r-- 1 root root 18K 31.03.2019 11:08 osprobed.cfg
Booting now ...
I am too stupid didn't look in boot/grub/ , again ...
I have no windows installation. When I find some grub.cfg from a multiboot with windows, I'll try to find a solution
When running the auto save to system parameter, the reporting message says that the new configuration is saved at the temporary (working) folder.
$ sudo horizontal-grub -s system
The new configuration file is created as /tmp/horizontal-grub-1559994982/horizontal-grub.cfg
$ sudo grep horizontal /boot/grub/grub.cfg
#### Trasformed grub menu to pseudo-horizontal by horizontal-grub ####
It will be fixed when I find some time. It is a cosmetic issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.