mawk 1.33 of Ubuntu 10.10 still has problems with RS="\0".
Part of boot info script where RS="\0" is used:
------------------------------------------------------------------------------------------
get_embedded_menu () {
local source=$1 titlename=$2;
# Check if magic bytes that go before the embedded menu, are present.
offset_menu=$(dd if="${source}" count=4 bs=128k 2>> ${Trash} | hexdump -v -e '/1 "%02x"' | grep -b -o 'b0021ace000000000000000000000000');
if [ -n ${offset_menu} ] ; then
# Magic found.
titlebar_gen "${titlename}" " embedded menu";
echo '--------------------------------------------------------------------------------' >> "${Log1}";
Compile the new version of mawk and do:
sed -e 's|gawk|/home/user/mawk-1.3.4-20100625/mawk|' boot_info_script-gawk.sh > boot_info_script-mawk-1.3.4.sh
Run boot_info_script-gawk.sh and boot_info_script-mawk-1.3.3.sh:
sudo bash boot_info_script-gawk.sh RESULT-gawk.txt
sudo bash boot_info_script-mawk-1.3.3.sh RESULT-mawk-1.3.3.txt
sudo bash boot_info_script-mawk-1.3.4.sh RESULT-mawk-1.3.4.txt
Compare the output files:
diff -u RESULT-mawk-1.3.3.txt RESULT-gawk.txt ==> a lot of differences
diff -u RESULT-mawk-1.3.4.txt RESULT-gawk.txt ==> no difference
For mawk-1.3.3, you will see something like this:
========================== sdb1/grldr embedded menu: ===========================
Can this mawk binary be upgraded or can the default awk been set to gawk if mawk can't be updated?
Shipping a broken awk (mawk v1.33) as default is wrong, IMHO.
mawk 0.3.4 probably solves a lot of other reported bugs too.
mawk 1.33 of Ubuntu 10.10 still has problems with RS="\0".
Part of boot info script where RS="\0" is used: ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------
-------
get_embedded_menu () {
local source=$1 titlename=$2;
# Check if magic bytes that go before the embedded menu, are present. 000000000000000 000');
offset_menu=$(dd if="${source}" count=4 bs=128k 2>> ${Trash} | hexdump -v -e '/1 "%02x"' | grep -b -o 'b0021ace000000
if [ -n ${offset_menu} ] ; then ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----' >> "${Log1}";
# Magic found.
titlebar_gen "${titlename}" " embedded menu";
echo '------
# Calcutate the exact offset to the embedded menu. menu=$( ( ( ${offset_menu%:*} / 2 ) + 16 ));
offset_
dd if="${source}" count=1 skip=1 bs=${offset_menu} 2>> ${Trash} | ${AWK} 'BEGIN { RS="\0" } { if (NR == 1) print $0 }' >> "${Log1}";
echo '------ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----' >> "${Log1}"; ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------
fi
}
-------
I found a version of mawk, maintained by a new developer: invisible- island. net/mawk/
http://
New mawk changelog (debian patches included + new things): invisible- island. net/mawk/ CHANGES
http://
How to reproduce:
-----------------
Download the development version of boot_info_script: script- gawk.sh 'http:// bootinfoscript. git.sourceforge .net/git/ gitweb. cgi?p=bootinfos cript/bootinfos cript;a= blob_plain; f=boot_ info_script. sh;hb=2cc05957f f2c1ac777be1145 14e57ed54fb2298 9'
wget -O boot_info_
Replace gawk with mawk: script- gawk.sh > boot_info_ script- mawk-1. 3.3.sh
sed -e 's|gawk|mawk|' boot_info_
Copy grldr (grub4dos) file to the root of a partition: code.google. com/p/grub4dos- chenall/ downloads/ list
http://
Compile the new version of mawk and do: /home/user/ mawk-1. 3.4-20100625/ mawk|' boot_info_ script- gawk.sh > boot_info_ script- mawk-1. 3.4.sh
sed -e 's|gawk|
Run boot_info_ script- gawk.sh and boot_info_ script- mawk-1. 3.3.sh: script- gawk.sh RESULT-gawk.txt script- mawk-1. 3.3.sh RESULT- mawk-1. 3.3.txt script- mawk-1. 3.4.sh RESULT- mawk-1. 3.4.txt
sudo bash boot_info_
sudo bash boot_info_
sudo bash boot_info_
Compare the output files: mawk-1. 3.3.txt RESULT-gawk.txt ==> a lot of differences mawk-1. 3.4.txt RESULT-gawk.txt ==> no difference
diff -u RESULT-
diff -u RESULT-
For mawk-1.3.3, you will see something like this: ======= ======= ===== sdb1/grldr embedded menu: ======= ======= ======= ======
=======
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- --- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---
pxe detect
configfile
default 0
timeout 1
-------
For gawk and mawk-1.3.4, you will see something like this (correct): ======= ======= ===== sdb1/grldr embedded menu: ======= ======= ======= ======
=======
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---
pxe detect
configfile
default 0
timeout 1
title find /menu.lst, /boot/grub/ menu.lst, /grub/menu.lst
errorcheck off
configfile /menu.lst || configfile /MENU.LST
configfile /boot/grub/menu.lst || configfile /BOOT/GRUB/MENU.LST
configfile /grub/menu.lst || configfile /GRUB/MENU.LST
find --set-root --ignore-floppies --ignore-cd /menu.lst && configfile /menu.lst
find --set-root --ignore-floppies --ignore-cd /boot/grub/menu.lst && configfile /boot/grub/menu.lst
find --set-root --ignore-floppies --ignore-cd /grub/menu.lst && configfile /grub/menu.lst
errorcheck on
commandline
title commandline
commandline
title reboot
reboot
title halt
halt
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---
Another bug in mawk is also solved in the mawk 0.3.4 version: /bugs.launchpad .net/ubuntu/ +source/ mawk/+bug/ 716920
https:/
Can this mawk binary be upgraded or can the default awk been set to gawk if mawk can't be updated?
Shipping a broken awk (mawk v1.33) as default is wrong, IMHO.
mawk 0.3.4 probably solves a lot of other reported bugs too.