From: Nick Pollitt <npollitt@mvista.com>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: kaos@sgi.com, Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Configure mangles hex values
Date: Mon, 24 Jan 2005 14:41:56 -0800 [thread overview]
Message-ID: <200501241441.56586.npollitt@mvista.com> (raw)
In-Reply-To: <200501241416.36422.npollitt@mvista.com>
Sorry about previous message.
The hex function in scripts/Configure strips the leading 0x from hex values.
The 0x needs to be there in autoconf.h, and stripping it out causes the
following problematic scenario:
If I start with a hex value in my config file like this:
CONFIG_LOWMEM_SIZE=0x40000000
and then run make oldconfig, it strips out the '0x' so I end up with this:
CONFIG_LOWMEM_SIZE=40000000
Then if I run make xconfig, it doesn't think this is a valid hex value, so it
replaces my value with the default:
CONFIG_LOWMEM_SIZE=0x20000000
The following patch removes the lines that strip out 0x, and inserts the 0x if
appropriate.
--- scripts/Configure.orig 2005-01-24 13:31:55.000000000 -0800
+++ scripts/Configure 2005-01-24 13:34:20.000000000 -0800
@@ -378,15 +378,18 @@
function hex () {
old=$(eval echo "\${$2}")
def=${old:-$3}
- def=${def#*[x,X]}
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
- ans=${ans#*[x,X]}
- if expr "$ans" : '[0-9a-fA-F][0-9a-fA-F]*$' > /dev/null; then
- define_hex "$2" "0x$ans"
+ if expr "$ans" : '0x[0-9a-fA-F][0-9a-fA-F]*$' > /dev/null; then
+ define_hex "$2" "$ans"
break
else
- help "$2"
+ if expr "$ans" : '[0-9a-fA-F][0-9a-fA-F]*$' > /dev/null; then
+ define_hex "$2" "0x$ans"
+ break
+ else
+ help "$2"
+ fi
fi
done
}
next prev parent reply other threads:[~2005-01-24 22:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-24 22:16 Configure mangles hex values Nick Pollitt
2005-01-24 22:41 ` Nick Pollitt [this message]
2005-01-25 9:20 ` Marcelo Tosatti
2005-01-25 17:25 ` Nick Pollitt
2005-01-26 1:10 ` Keith Owens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200501241441.56586.npollitt@mvista.com \
--to=npollitt@mvista.com \
--cc=kaos@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.