From edb9c0d7b09c69cad50b01055168bb8d52ed7489 Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 17 Jun 2000 08:48:28 +0000 Subject: [PATCH] add a mem option into Linux automatically only if the user doesn't specify it explicitly. --- ChangeLog | 5 +++++ configure | 4 ++-- stage2/boot.c | 17 +++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62d594cc3..6df7502ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-06-17 OKUJI Yoshinori + + * stage2/boot.c (load_image): Pass a mem option to Linux, only + if SRC has no substring "mem=". + 2000-06-17 OKUJI Yoshinori * stage2/compile: Removed. diff --git a/configure b/configure index 9f9c50a23..b022377f4 100644 --- a/configure +++ b/configure @@ -622,7 +622,7 @@ fi ac_aux_dir= -for ac_dir in aux $srcdir/aux; do +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -634,7 +634,7 @@ for ac_dir in aux $srcdir/aux; do fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in aux $srcdir/aux" 1>&2; exit 1; } + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub diff --git a/stage2/boot.c b/stage2/boot.c index 4d7d6dcf1..e73dc9509 100644 --- a/stage2/boot.c +++ b/stage2/boot.c @@ -271,12 +271,17 @@ load_image (char *kernel, char *arg, kernel_t suggested_type) *((unsigned short *) CL_OFFSET) = CL_MY_LOCATION - CL_BASE_ADDR; *((unsigned short *) CL_MAGIC_ADDR) = CL_MAGIC; - grub_memmove (dest, "mem=", 4); - dest += 4; - - dest = convert_to_ascii (dest, 'u', (extended_memory + 0x400)); - *(dest++) = 'K'; - *(dest++) = ' '; + /* Add a mem option automatically only if the user doesn't + specify it explicitly. */ + if (! grub_strstr (src, "mem=")) + { + grub_memmove (dest, "mem=", 4); + dest += 4; + + dest = convert_to_ascii (dest, 'u', (extended_memory + 0x400)); + *(dest++) = 'K'; + *(dest++) = ' '; + } while (*src && *src != ' ') src++;